Skip to content

Instantly share code, notes, and snippets.

@trico
Created May 18, 2011 22:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save trico/979709 to your computer and use it in GitHub Desktop.
Save trico/979709 to your computer and use it in GitHub Desktop.
Comandos git

####Crear una rama y directamente hacer checkout en ella git checkout -b myfeature develop

####Merge especial git merge --no-ff myfeature

####Eliminar una rama git branch -d myfeature

####Crear tag

git tag -a 1.2.1

####Commit con add de todos los archivos

git commit -a -m 'Mensaje'

####Crear zip del último commit

git archive --format=zip HEAD `git diff HEAD^ HEAD --name-only` > update.zip

####Crear zip desde un commit en concreto hasta el head

git archive --format=zip HEAD `git diff commit_id HEAD --name-only` > update.zip

####Crear zip desde un commit en concreto hasta otro

git archive --format=zip HEAD `git diff commit_id-origen commit_id-final --name-only` > update.zip

####Renombrar una branch

git branch -m old_branch new_branch

####Iniciar server git

git daemon --base-path=d:/wamp/www --export-all --port=9999

####Cuando nos da error que no encuentra un archivo al intentar montar un deploy cambiamos el git diff filter para que nos devuelva todos los archivos menos los eliminados

git diff HEAD^ HEAD --name-only --diff-filter=ACMRTUXB

####Cuando queremos quitar un archivo que ya esta añadido, es decir lo contrario de git add

git reset nombre_el_archivo

####Ignorar temporalmente un archivo

git update-index --assume-unchanged <file>

Volver a trackearlo:

git update-index --no-assume-unchanged <file>

Listado de archivos temporalmente ignorados:

git ls-files -v | grep ^[a-z]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment