Comandos y metodos sobre Git Hub
This project is maintained by Lekanda
Metodos —
Tu puedes usar el editor on GitHub utilizando para editar, Markdown.
git add . && git commit -m “DescripcionDeCommit“ => Ejecuta dos comandos a la vez
git config --global user.name "nombre de usuario"
git config --global user.email "password de usuario"
git config --global -e =>
git config --global -l =>
git config user.name =>
git config --global alias.lg "log --oneline --decorate --all --graph"
–oneline => una linea por commitgit config --global alias.s "status -s -b"
git config --global alias.s "branch"
git init
Se puede tambien clonar un repositorio de alguien
git remote -v
Comandos para añadir archivos al Stage
Con el Alias actual seria: git lg. Añane mas opciones
Pero se puede usar tambien git log
git s
git reset HEAD _archivo.ext
gir rest --soft HEAD^
git checkout -- archivo.ext
git checkout -- .
ES PELIGROSO, mejor usar el REVERT, pero bien usado es una buena herramienta.
git reset f6e2697
git reset --hard hashCommit
git reset --soft hashCommit
git reset --mixed hashCommit
Es parecido a RESET pero menos peligroso.
git revert hashCommit
git revert HEAD
git revert --no-commit HEAD
git revert --no-commit HEAD~1
git revert --no-commit HEAD~2
git revert --continue
Con Alias git br
git branch nombre-rama
git checkout nombre-rama
git checkout -b nombre-rama
git branch
git branch -d nombre-rama
git branch -m nombre-rama-viejo nombre-rama-nuevo
git branch -a
git merge nombre-rama
git merge --abort
git merge origin/master
git tag nombre-tag
git tag
git tag -d nombre-tag
git tag -a v0.0.1 -m "descrpcion de TAG"
git tag -a v0.0.1 hashCommit -m "descrpcion de TAG"
git tag v0.0.1 hashCommit
git show nombre-tag
git checkout v0.1.0
git tag -l "v0.1.*"
Comando | Explicacion |
---|---|
git stash | Guarda en el Stash los archivos modificados, y lo que este en el Stage |
git stash list | Lista los Stashs creados |
git stash list –stat | Lista los Stashs creados con mas info |
git show stash | Mas info de los Stash |
git show stash@{3} | Mas info de Stash 3 |
git stash -h | Da comandos de ayuda |
git stash apply | Aplica los ultimos cambios que se han hecho en el stash y lo mete donde estes trabajando |
git stash apply stash@{3} | Aplica los cambios del Stash 3 y lo mete donde estes trabajando |
git stash drop | Borra el primero en la lista de los Stash |
git stash drop stash@{2} | En este ejemplo borra el segundo en la lista de los Stash |
git stash clear | :warning: CUIDADO: Borra todas las entradas del Stash :warning: |
git stash save “Comentario del Stash” | Comentar un Stash |
git stash pop | Hace los mismo que git stash apply |
Comando | Explicacion |
---|---|
git remote add origin URLdeRepositorioRemoto | Añade un repositorio remoto al proyecto |
git remote | Nos da los remotos |
git remote -v | Nos da los push y fetch remotos |
Comando | Explicacion |
---|---|
git clone urlRepositorioaClonar nombreCarpeta(opcional) | Clona el repositorio a la carpeta donde se esta |
Comando | Explicacion |
---|---|
git push origin master | Sube cambios al remoto origin |
git push origin –all | Sube varias ramas a la vez de golpe |
git push | Una vez hecho git push origin master con este vale para subir los cambios al repositorio remoto |
git fetch origin
=> Sirve para preguntar a un remoto sí hay novedades, y sí las ahi descargarlas al repo local
2-Comando | Explicacion |
---|---|