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 sgit reset HEAD _archivo.extgir rest --soft HEAD^git checkout -- archivo.extgit checkout -- .ES PELIGROSO, mejor usar el REVERT, pero bien usado es una buena herramienta.
git reset f6e2697git reset --hard hashCommitgit reset --soft hashCommitgit reset --mixed hashCommitEs parecido a RESET pero menos peligroso.
git revert hashCommitgit revert HEADgit revert --no-commit HEADgit revert --no-commit HEAD~1git revert --no-commit HEAD~2git revert --continueCon Alias git br
git branch nombre-ramagit checkout nombre-ramagit checkout -b nombre-ramagit branchgit branch -d nombre-ramagit branch -m nombre-rama-viejo nombre-rama-nuevogit branch -agit merge nombre-ramagit merge --abortgit merge origin/mastergit tag nombre-taggit taggit tag -d nombre-taggit 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 hashCommitgit show nombre-taggit checkout v0.1.0git 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 |
|---|---|