Herramientas de usuario

Herramientas del sitio


linux:sistemaoperativo:git

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
linux:sistemaoperativo:git [2019/02/04 12:50] grillolinux:sistemaoperativo:git [2019/02/12 11:52] (actual) grillo
Línea 2: Línea 2:
 ========== ==========
  
-clonar separando código y .git en distintos directorios+clonar separando código y .git en distintos directorios 
 ``` ```
 $ git clone --separate-git-dir /tmp/1/unaprueba  ssh://git-test.pm.rosario.gov.ar/datos/git/web.git --branch desarrollo $ git clone --separate-git-dir /tmp/1/unaprueba  ssh://git-test.pm.rosario.gov.ar/datos/git/web.git --branch desarrollo
Línea 23: Línea 23:
  
 clonar contra https con certificado erroneo clonar contra https con certificado erroneo
-``` +```
 GIT_SSL_NO_VERIFY=true git clone https://gitlab.tecso.coop/tecso/siat-rosario.git GIT_SSL_NO_VERIFY=true git clone https://gitlab.tecso.coop/tecso/siat-rosario.git
 git config http.sslVerify "false" git config http.sslVerify "false"
Línea 39: Línea 39:
  
 ver ramas locales ver ramas locales
-``` +```
 $ git branch  $ git branch 
 ``` ```
  
 comparar repositorio local con el origin comparar repositorio local con el origin
-``` +```
 git remote show origin  git remote show origin 
 ``` ```
  
 agregar archivos nuevos al área de trabajo para commit agregar archivos nuevos al área de trabajo para commit
-``` +```
 git add .  git add . 
 ``` ```
  
 ver cambios que se grabarán en el próximo commit ver cambios que se grabarán en el próximo commit
-``` +```
 git status  git status 
 ``` ```
 commit con mensaje commit con mensaje
-``` +```
 git commit -a -m 'mensaje descriptivo'  git commit -a -m 'mensaje descriptivo' 
 ``` ```
  
 agregar archivo olvidado al último commit agregar archivo olvidado al último commit
-``` +```
 git commit --amend  git commit --amend 
 ``` ```
  
 ver historial de commits ver historial de commits
-``` +```
 git log --stat  git log --stat 
 ``` ```
  
 ver historial de commits abreviado ver historial de commits abreviado
-``` +```
 git log --pretty=oneline  git log --pretty=oneline 
 ``` ```
  
 ver diferencias entre último commit y el anterior ver diferencias entre último commit y el anterior
-``` +```
 git log -p -2  git log -p -2 
 ``` ```
  
 ver árbol de versionados ver árbol de versionados
-``` +```
 git log --pretty=format:"%h %s" --graph  git log --pretty=format:"%h %s" --graph 
 ``` ```
  
 volver a un commit anterior volver a un commit anterior
-``` +```
 git revert 0d1d7fc32  git revert 0d1d7fc32 
 ``` ```
  
 anular últimos commits perdiendo cambios anular últimos commits perdiendo cambios
-``` +```
 git reset --hard 0d1d7fc32  git reset --hard 0d1d7fc32 
 ``` ```
  
 crear nueva rama (igual al commit actual) crear nueva rama (igual al commit actual)
-``` +```
 git branch testing  git branch testing 
 ``` ```
  
 borrar rama local borrar rama local
-``` +```
 git branch -d the_local_branch  git branch -d the_local_branch 
 ``` ```
  
-borrar rama remota``` +borrar rama remota 
 +``` 
 git push origin :the_remote_branch  git push origin :the_remote_branch 
 ``` ```
Línea 118: Línea 119:
  
 limpiar entorno sucio por cambios no aplicados: 1-ver 2-aplicar limpiar entorno sucio por cambios no aplicados: 1-ver 2-aplicar
-``` +```
 git clean -n  git clean -n 
 git clean -f  git clean -f 
Línea 125: Línea 126:
 revertir un archivo a un estado varios commits anterior revertir un archivo a un estado varios commits anterior
 ver contenido del archivo en el commit ver contenido del archivo en el commit
-``` +```
 git show a4r9593432:path/to/file.txt  git show a4r9593432:path/to/file.txt 
 ``` ```
Línea 134: Línea 135:
 ``` ```
 revisar las diferencias revisar las diferencias
-``` +```
 git diff --cached path/to/file.txt  git diff --cached path/to/file.txt 
 ``` ```
 aplicar el cambio aplicar el cambio
-``` +```
 git commit  git commit 
 ``` ```
Línea 148: Línea 149:
  
 ver diferencias entre version actual y 2 versiones anteriores de un archivo ver diferencias entre version actual y 2 versiones anteriores de un archivo
-``` +```
 git diff HEAD@{2} /foo/bar/baz.txt  git diff HEAD@{2} /foo/bar/baz.txt 
 ``` ```
  
 crear tag crear tag
-``` +```
 git tag -a v1.4 -m "my version 1.4"  git tag -a v1.4 -m "my version 1.4" 
 ``` ```
 +
 crear tag desde commit crear tag desde commit
-``` +```
 git tag -a v1.2 0b7434d86859cc7b8c3d5e1dddfed66ff742fcbc  git tag -a v1.2 0b7434d86859cc7b8c3d5e1dddfed66ff742fcbc 
 ``` ```
  
 crear tag liviano (solo info del commit) crear tag liviano (solo info del commit)
-``` +```
 git tag v1.4  git tag v1.4 
 ``` ```
Línea 240: Línea 242:
  
 Mensaje con servidor y repositorio Mensaje con servidor y repositorio
-``` +```
 $ git config hooks.showrev "t=%s; printf 'http://your_repository_IP/gitrepo/?p=my_git_project;a=commitdiff;h=%%s' \$t; echo;echo; git show -C \$t; echo"  $ git config hooks.showrev "t=%s; printf 'http://your_repository_IP/gitrepo/?p=my_git_project;a=commitdiff;h=%%s' \$t; echo;echo; git show -C \$t; echo" 
 ``` ```
Línea 269: Línea 271:
 1) 1)
 Clonar repositorio Clonar repositorio
-``` +```
 git clone ssh://usuario@git-test.pm.rosario.gov.ar/datos/git/svc/debian7base.git/ --branch master  git clone ssh://usuario@git-test.pm.rosario.gov.ar/datos/git/svc/debian7base.git/ --branch master 
 cd debian7base  cd debian7base 
Línea 287: Línea 289:
  
 Agregar archivos nuevos al indice Agregar archivos nuevos al indice
-``` +```
 git add .  git add . 
 ``` ```
  
 Modificar archivos existentes Modificar archivos existentes
-``` +```
 vim README  vim README 
 ``` ```
linux/sistemaoperativo/git.1549284653.txt.gz · Última modificación: 2019/02/04 12:50 por grillo