Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - h3ch1c3r0

#1
GNU/Linux / Problema con git subir archivos
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


[youtube=640,360]
https://www.youtube.com/watch?v=PcCgAu2zJiw
[/youtube]

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:
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:


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$