elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: MinusFour)
| | |-+  Problema con git subir archivos
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Problema con git subir archivos  (Leído 1,771 veces)
h3ch1c3r0

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Problema con git subir archivos
« en: 17 Febrero 2018, 22:12 pm »

Hola, tengo una maquina virtual con ubuntu y servidor git, en dicha maquina creo la carpeta del proyecto, llamada ip, con el usuario con permisos llamado git que cree en la instalación del control de versiones. Pero no consigo subir los archivos al servidor. Si alguien tiene alguna idea agradecería su ayuda. Muchas gracias




La terminal de la izquierda es el servidor git en virtualbox y la de la derecha es el cliente.

Esto es lo que hago primero en el server, maquina virtual:
Código:
root@serveradmin:/home/alberto/git/ip# git init
Reinitialized existing Git repository in /home/alberto/git/ip/.git/
root@serveradmin:/home/alberto/git/ip# ls -a -l
total 12
drwxrwsr-x 3 git  root 4096 Jan 22 19:47 .
drwxr-xr-x 5 git  root 4096 Jan 22 17:55 ..
drwxr-sr-x 7 root root 4096 Jan 23 00:45 .git
root@serveradmin:/home/alberto/git/ip# chown git .git/
root@serveradmin:/home/alberto/git/ip# ls -a -l
total 12
drwxrwsr-x 3 git root 4096 Jan 22 19:47 .
drwxr-xr-x 5 git root 4096 Jan 22 17:55 ..
drwxr-sr-x 7 git root 4096 Jan 23 00:45 .git
root@serveradmin:/home/alberto/git/ip# chmod -R 777 .git
root@serveradmin:/home/alberto/git/ip# git config receive.denyCurrentBranch ignore
root@serveradmin:/home/alberto/git/ip#
root@serveradmin:/home/alberto/git/ip# git config receive.denyCurrentBranch ignore
root@serveradmin:/home/alberto/git/ip# ls
root@serveradmin:/home/alberto/git/ip# ls -l
total 0
root@serveradmin:/home/alberto/git/ip# cd ..
root@serveradmin:/home/alberto/git# ls
appaliminalia  appgest  ip
root@serveradmin:/home/alberto/git# cd ip/
root@serveradmin:/home/alberto/git/ip# ls
root@serveradmin:/home/alberto/git/ip#

Para el cliente realizo lo siguiente:


Código:
albertos-iMac:a alberto$ ls
ip.php  ip.sh
albertos-iMac:a alberto$ git init
Initialized empty Git repository in /Users/alberto/Desktop/SCRIPT_IP/a/.git/
albertos-iMac:a alberto$ git add .
albertos-iMac:a alberto$ git status
On branch master

Initial commit

Changes to be committed:
(use "git rm --cached <file>..." to unstage)

new file:   ip.php
new file:   ip.sh

albertos-iMac:a alberto$ git commit -m "prueba"
[master (root-commit) 8970f3b] prueba
Committer: alberto <alberto@albertos-iMac.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

2 files changed, 140 insertions(+)
create mode 100644 ip.php
create mode 100755 ip.sh
albertos-iMac:a alberto$ git status
On branch master
nothing to commit, working directory clean
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://git@192.168.0.120/home/alberto/git/ip
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@192.168.0.120/home/alberto/git/ip'
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://git@192.168.0.120/home/alberto/git/ip
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@192.168.0.120/home/alberto/git/ip'
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://git@192.168.0.120/home/alberto/git/ip
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@192.168.0.120/home/alberto/git/ip'
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://git@192.168.0.120/home/alberto/git/ip
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'ssh://git@192.168.0.120/home/alberto/git/ip'
albertos-iMac:a alberto$ git git remote add ssh://git@192.168.0.120/home/alberto/git/ip master
git: 'git' is not a git command. See 'git --help'.

Did you mean this?
init
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://git@192.168.0.120/home/alberto/git/ip
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'ssh://git@192.168.0.120/home/alberto/git/ip'
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.34 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To ssh://git@192.168.0.120/home/alberto/git/ip
* [new branch]      master -> master
albertos-iMac:a alberto$ git status
On branch master
nothing to commit, working directory clean
albertos-iMac:a alberto$ git add .
albertos-iMac:a alberto$ git status
On branch master
nothing to commit, working directory clean
albertos-iMac:a alberto$ git commit -m "prueba22"
On branch master
nothing to commit, working directory clean
albertos-iMac:a alberto$ git push ssh://git@192.168.0.120/home/alberto/git/ip master
git@192.168.0.120's password:
Everything up-to-date
albertos-iMac:a alberto$


« Última modificación: 18 Febrero 2018, 13:36 pm por h3ch1c3r0 » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Subir archivos a un ftp « 1 2 3 »
Programación Visual Basic
RED_HORSE 22 7,950 Último mensaje 28 Abril 2006, 01:40 am
por RED_HORSE
Subir archivos...
Programación Visual Basic
sp26 2 1,899 Último mensaje 30 Diciembre 2006, 12:46 pm
por skapunky
Problema al generar Código php para subir archivos a mi FTP
PHP
WiseHidden 5 4,617 Último mensaje 24 Septiembre 2012, 22:39 pm
por WiseHidden
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines