Git avanzado
Temario
- Propósito y alcance
- Arquitectura
- Componentes fundamentales
- Operaciones CRUD
- Operaciónes de organización de código
- Gestión de ramas y etiquetas
- Resolución de conflictos
- Integración con Maven
- Configuración de GIT
- Introducción a GIT en el lado servidor
- Programas cliente para operar con GIT
Conceptos iniciales
Conceptos iniciales
-
Qué es el control de versiones
-
VCS centralizados / distribuidos
-
CLI vs GUI
-
Branching
Instalación
Instalación
-
Marcar o asegurarse de que está marcado:
-
Git Bash Here
-
Use Notepad++ as Git's default editor
-
Use Git from the Windows Command Prompt
-
Checkout Windows-style, commit Unix-style etc.
-
Use MinTTY
-
Configuración inicial
git config --global http.proxy http://username:password@host:port
git config --global https.proxy http://username:password@host:port
git config --global user.name "Mario González"
git config --global user.email mario@mariogl.com
Fundamentos de Git
Fundamentos de Git
-
Snapshots (commits)
-
Repositorio
-
Working directory/tree
-
Stage/index/cache
-
Referencias
- Ramas
- HEAD
- Tags
- .gitignore
Commits
Preparando el commit
-
Añadir al índice con git add
-
Añadir de manera interactiva con git add -i
-
Ver qué archivos hay en el índice con git ls-files
-
Quitar archivos o modificaciones del índice con git rm o git checkout
-
Hacer el commit con git commit
-
Modificar el último commit con git commit --amend
El commit
-
Hash SHA-1
-
Autor / commiteador
-
Fecha
-
Mensaje
-
Padre/s
El log
-
git log para ver el histórico de commits
-
Referencias en el log
-
Ver el log compacto con git log --oneline
-
Ver un commit con git show y git ls-tree
-
Cómo referenciar a un commit
-
SHA-1
-
HEAD^
-
HEAD~
-
HEAD@{n}
-
El log
Saltar a otro commit con git checkout
Borrar commits con git reset
Ver el histórico de HEADs con git reflog
-
Apartar cambios provisionalmente con git stash
git stash
git stash list
git stash show stash@{n} -v
git stash apply [stash@{n}]
git stash pop
git stash drop
Branching
Ramas
-
Referencia
-
La rama master
-
Listar ramas
-
Crear una rama con git branch
-
Ir a una rama con git checkout
-
Borrar una rama con git branch -d
-
Mezclar dos ramas con git merge
-
Mezclar dos ramas con git rebase
-
Aplicar un commit de otra rama con cherry-pick -x
El modelo git flow
-
master
-
develop
-
feature branch
-
bugfix branch
-
release branch
-
hotfix branch
-
Instalación
Repositorios remotos
Repositorios online
Repositorios remotos
-
Clonar con git clone
-
El remote origin
-
Añadir un remote con git remote add
-
Renombrar un remote con git remote rename
-
Borrar un remote con git remote remove
-
Tracking branch
Repositorios remotos
-
Enviar cambios al repositorio remoto con git push
-
Sincronizar mi copia local del remoto con git fetch
-
Mergear cambios del remoto con git merge
-
git fetch + git merge = git pull
-
Borrar ramas del remoto
-
Marcar ramas remotas borradas con git fetch --prune
-
Ver lo que voy a enviar en el push con
git diff origin/master..origin
GUI
GUI para Git
Git & Maven
Git & Maven
Links
Git avanzado
By mariogl
Git avanzado
Curso Git avanzado Madrid 13-14 diciembre 2017
- 995