Created
June 18, 2009 10:50
-
-
Save rgo/131846 to your computer and use it in GitHub Desktop.
Git Notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FORK - PUSH - PULL - KEEPING THE TRACK | |
====================================== | |
FORK | |
==== | |
Le doy a fork en el repositorio y luego uso "Your clone URL". | |
$ git clone [email protected]:rgo/drgtest.git | |
Modifico los ficheros que necesite y los añado: | |
$ git add <fichero> | |
o | |
$ git add --all | |
Lo commiteamos: | |
$ git commit [-m 'texto'] | |
PUSH | |
==== | |
Luego lo subimos al servidor(push): | |
$ git push origin master | |
PULL | |
==== | |
Hacemos una petición de pull ("Pull request") en la página de nuestro repositorio y así avisamos al dueño del proyecto de los cambios. | |
KEEPING THE TRACK | |
================= | |
Para seguirle el rastro lo que haremos será ponerle un nombre al repositorio remoto, en este caso golliher_drgtest: | |
$ git remote add golliher_drgtest git://github.com/golliher/drgtest.git | |
(Para comprobarlo: git remote show golliher_drgtest) | |
Para traer todos los objetos y almacenarlos localmente: | |
$ git fetch golliher_drgtest | |
Para actualizar nuestro repositorio local con la última revisión commiteada en el repositorio remoto: | |
$ git pull golliher_drgtest master | |
(Para ver el log remoto: git log golliher_drgtest/master) | |
NOTA: El comando "pull" en este caso está haciendo 2 comandos: git fetch golliher_drgtest && git merge golliher_drgtest/master | |
BRANCHES CREATE - MERGE - DELETE - REVERSING | |
============================================ | |
CREATE | |
====== | |
Creamos la branch: | |
$ git branch display | |
La seleccionamos: | |
$ git checkout display | |
Añadimos los ficheros que necesitemos: | |
$ git add foo.rb | |
$ git commit -m 'Foo class added' | |
$ git push origin display | |
Volvemos a la branch master: | |
$ git checkout master | |
(nota: para ver las diferencias "git diff master display") | |
MERGE | |
===== | |
$ git merge display | |
Si no hay conflicto el merge hace add y commit. Si lo hay entonces que hay solucionarlo y hacerlo a mano(add y commit). | |
DELETE | |
====== | |
Borramos el branch del repositorio local: | |
$ git branch -d display | |
Subimos los cambios a github: | |
$ git push origin master | |
Ahora lo borramos del repositorio remoto(github): | |
$ git push origin :display | |
REVERSING(last commit) | |
========= | |
$ git reset --hard ORIG_HEAD | |
TAGS CREATE - DELETE | |
=========================== | |
CREATE | |
====== | |
Lo creamos: | |
$ git tag display_commit | |
Para subirlo a github: | |
$ git push origin display_commit | |
(nota: para subir todos los tags "git push origin --tags") | |
DELETE | |
====== | |
$ git push origin :display_commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment