Mover proyectos con Git y una USB
Para mover un proyecto usando una usb, desde la usb con el bash de git , ejecutar un clone, ejemplo:
F:\>git clone /C/Codigo/Proyecto
el Git al crear una copia del proyecto guarda la referencia al origen , la cual la podemos consultar con:
F:\Proyecto\>git remote -v
después podemos hacer lo mismo moviendo el código a un directorio en una PC donde vamos a trabajar, podemos hacer de nuevo un clone:
C:\Documentos\>git clone /F/Proyecto
hacemos cambios, y hacemos un commit, en el directorio donde estamos trabajando, y posteriormente podemos aplicar lo que hicimos a la usb. Aqui se me presento un error parecido a lo siguiente:
remote: error: refusing to update checked out branch: refs/heads/feature-senddata
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set 'receive.denyCurrentBranch' configuration variable to
remote: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
La solucion la encontre aqui;
http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked
basicamente lo que hay que hacer, es en nuestra usb, ejecutar el bash de Git, crear un nuevo branch temporal, aplicar los cambios con un push desde el remoto, y luego podemos borrar el branch que creamos temporal.
en la USB:
F:\Proyecto>git checkout -b temp
en el directorio remoto:
C:\Documentos\Proyecto\>git push
finalmente en la usb podemos borrar el branch "temp":
F:\Proyecto>git checkout master
F:\Proyecto>git branch -d temp
donde "master" es el branch donde aplicamos los cambios y "temp" el que creamos temporal y que no se puede borrar si ya no se necesita
F:\>git clone /C/Codigo/Proyecto
el Git al crear una copia del proyecto guarda la referencia al origen , la cual la podemos consultar con:
F:\Proyecto\>git remote -v
después podemos hacer lo mismo moviendo el código a un directorio en una PC donde vamos a trabajar, podemos hacer de nuevo un clone:
C:\Documentos\>git clone /F/Proyecto
hacemos cambios, y hacemos un commit, en el directorio donde estamos trabajando, y posteriormente podemos aplicar lo que hicimos a la usb. Aqui se me presento un error parecido a lo siguiente:
remote: error: refusing to update checked out branch: refs/heads/feature-senddata
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set 'receive.denyCurrentBranch' configuration variable to
remote: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked
basicamente lo que hay que hacer, es en nuestra usb, ejecutar el bash de Git, crear un nuevo branch temporal, aplicar los cambios con un push desde el remoto, y luego podemos borrar el branch que creamos temporal.
en la USB:
F:\Proyecto>git checkout -b temp
en el directorio remoto:
C:\Documentos\Proyecto\>git push
finalmente en la usb podemos borrar el branch "temp":
F:\Proyecto>git checkout master
F:\Proyecto>git branch -d temp
donde "master" es el branch donde aplicamos los cambios y "temp" el que creamos temporal y que no se puede borrar si ya no se necesita
Comentarios
Publicar un comentario