-
-
Save RodolVelasco/e6af0d59273e899b0d02e8eb37ff2383 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| git commands |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GIT comandos básicos
Comparar
diff -u old.html new.htmlLog de commits
git logComparar versiones del mismo file por id commit
git diff commit_id1 commit_id2Regresar a una version previa (checkout)
git checkout id_commitPara crear un checkout con una nueva branch (utilizar nuevamente checkout para lograr este comportamiento)
git checkout -b branch_nameDiferencia entre working directory and staging
git diffDiferencia entre staging y repository
git diff --stagedDiscard any changes in either the working directory or the staging area.
Si se borra, los cambios no pueden ser recuperados
git reset --hardBRANCHES
Muestra listado de branches
git branchCrear un branch
git branch any_argumentPara ubicarse en un branch
git checkout branch_nameVer log manera resumida
git log --graph --oneline master branch_nameRemeber that HEAD means current commit.

Un checkout sobre un commit se vería como la siguiente imagen. Se vería sin ninguna branch
Este tipo de commits no se muestran con
git logya que no pertenece a ninguna branchPara incorporarlo vamos a necesitar hacer un
git checkout -b new_branch_nameesto equivale a hacer dos comandos: git checkout y luego git branchgit show commit_idPara borrar un branch
git branch -d branch_nameLo querré borrar luego de haber hecho un merge. Los commits del branch no se pierden ni tampoco los del padre.