45. #TechFriday - Git
Fetch y Pull desde un Remote
# obtener toda la data que mi copia local no tiene
$ git fetch [nombre-remote]
# obtener cambios y hacer merge
$ git pull [nombre-remote]
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
46. #TechFriday - Git
Push cambios a Remote
# enviar mis cambios a un remote
$ git push [nombre-remote] [nombre-branch]
$ git push origin master
$ git push bitbucket master
# información del remote
$ git remote show origin
# remover remote
$ git remote rm bitbucket
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
47. #TechFriday - Git
Tags
# obtener un listado de tags
$ git tag
V0.1
super-feature
Estable
V0.2
# buscar un tag
$ git tag -l 'v0*'
V0.1
V0.2
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
48. #TechFriday - Git
Tags
# crear un tag anotado
$ git tag -a v0.3 -m 'Version 0.3'
$ git tag
V0.1
V0.2
V0.3
# ver informacion del tag
$ git show v.03
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
49. #TechFriday - Git
Tags
# firmar un tag con GPG
$ git tag -s v0.3 -m 'Version 0.3 firmada'
You need a passphrase to unlock the secret key for
user: "Javier Alvarez <jalvarez@blukite.com>"
1024-bit DSA key, ID F721C45A, created 2009-02-09
$ git show v0.3
tag v0.3
Tagger: Javier Alvarez <jalvarez@bluekite.com>
Date: Mon Feb 9 15:22:20 2009 -0800
Version 0.3 firmada
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iEYEABECAAYFAkmQurIACgkQON3DxfchxFr5cACeIMN+ZxLKggJQf0QYiQBwgySN
Ki0An2JeAVUCAiJ7Ox6ZEtK+NvZAj82/
=WryJ
-----END PGP SIGNATURE-----
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
51. #TechFriday - Git
Tags
# crear un tag anotado
$ git tag -a v0.3 -m 'Version 0.3'
$ git tag
V0.1
V0.2
V0.3
# ver informacion del tag
$ git show v.03
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
66. #TechFriday - Git
1. Trabajo en mi proyecto
2. Creo un branch para mi
feature
3. Hago cambios a mi branch
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
67. #TechFriday - Git
CAMBIO SUPER IMPORTANTE QUE NO
PUEDE ESPERAR O LOS MAYAS
DESTRUIRAN AL MUNDO!!!
( con los terrorristas...)
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
68. #TechFriday - Git
1. Regreso a master
2. Crear HotFix branch
3. Test. Merge HotFix → Master
4. Push a Producción
5. Regreso a Feature Branch
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
69. #TechFriday - Git
Merging – Mi Proyecto
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
70. #TechFriday - Git
Merging – Crear un feature branch
$ git branch -b iss53
Switched to a new branch "iss53"
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
81. #TechFriday - Git
Merging – Mergetool
$ git mergetool
merge tool candidates: kdiff3 tkdiff xxdiff meld gvimdiff
opendiff emerge vimdiff
Merging the files: index.html
Normal merge conflict for 'index.html':
{local}: modified
{remote}: modified
Hit return to start merge resolution tool (meld):
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
82. #TechFriday - Git
Merging – Commit
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
#
$ git commit
Merge branch 'iss53'
Conflicts:
index.html
#
# It looks like you may be committing a MERGE.
# If this is not correct, please remove the file
# .git/MERGE_HEAD
# and try again.
#
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
93. #TechFriday
No. 1
Javier Alvarez
@jmangt
Distribuido bajo Creative Commons Attribution Share Alike 3.0 Guatemala
Notas del editor
VCS rcs Suma los patches
Colaboracion CVS Subversion Perforce Checkout de archivos Se cae el server!!! Se corrompe la db! Hay que estar conectado! Lentos
Colaboracion CVS Subversion Perforce Checkout de archivos Se cae el server!!! Se corrompe la db! Hay que estar conectado! Lentos
Kernel BitKeeper Nace 2005
Cvs Subversion Perforce Bazar Cambios realizados por archivos
Mini filesystem Toma una foto Guarda archivos cambiados Genera un link a la ultima version de los no cambiados Operaciones locales, super rapido Difrencia hace un mes Offline
Git directory = db Git clone <= directory Working es un checkout de una version de repo Staging => archivo dentro de directory == Index Que entrara en el commit
Because a branch in Git is in actuality a simple file that contains the 40 character SHA-1 checksum of the commit it points to, branches are cheap to create and destroy. Creating a new branch is as quick and simple as writing 41 bytes to a file (40 characters and a newline).
It’s worth noting here that the work you did in your hotfix branch is not contained in the files in your iss53 branch. If you need to pull it in, you can merge your master branch into your iss53 branch by running git merge master, or you can wait to integrate those changes until you decide to pull the iss53 branch back into master later.
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging
Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two. Git creates a new snapshot that results from this three-way merge and automatically creates a new commit that points to it Git automatically identifies the best common-ancestor merge base for branch merging