71
Git avanzado Git avanzado

Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

  • Upload
    others

  • View
    38

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Git avanzadoGit avanzado

Page 2: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

TemarioTemarioConceptos inicialesInstalación y configuraciónFundamentos y arquitectura interna de GitCommitsConflictosBranchingRepositorios remotosInterfaces gráficasSubmódulosPull Requests

Git avanzado

Page 3: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conceptos inicialesConceptos iniciales

Git avanzado

Page 4: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Git avanzado

Page 5: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conceptos iniciales

Qué es el control de versionesVCS centralizados / distribuidosCLI vs GUIBranching

Git avanzado

Page 6: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación yInstalación yconfiguraciónconfiguración

Git avanzado

Page 7: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 8: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 9: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 10: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 11: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 12: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 13: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Instalación 

Notepad++

Marcar o asegurarse de que está marcado:Git Bash HereUse Notepad++ as Git's default editorUse Git from the Windows Command PromptCheckout Windows-style, commit Unix-style etc.Use MinTTYEnable Git Credential Manager

Crear una cuenta en  (con un email real)

Git

Bitbucket

Git avanzado

Page 14: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Configuración

Variables de configuraciónSistema (S.O.): git config --systemGlobal (usuario): git config --globalLocal (proyecto): git config [--local]

Guardar una variable de configuración:git config [tipo] nombre_variable valorPor ejemplo: git config --system user.name "Mario González"

Leer una variable de configuración:git config [tipo] nombre_variablePor ejemplo: git config --global user.name

Listar todas las variables de configuracióngit config [tipo] --list

Archivos de configuracióngit config [tipo] --list --show-origin

Git avanzado

Page 15: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Configuración inicial

Configuración proxy: git config --global http.proxy http://username:password@host:port git config --global https.proxy http://username:password@host:port

Configuración usuario: git config --global user.name "Mario González" git config --global user.email [email protected]

Git avanzado

Page 16: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Fundamentos de GitFundamentos de Git

Git avanzado

Page 17: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Fundamentos de Git

Snapshots (commits)RepositorioWorking directoryStage

Git avanzado

Page 18: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Fundamentos de Git

ReferenciasRamasHEADTags

.gitignore ( )Añadir tag: git tag nombre_tag

generador

Git avanzado

Page 19: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

CommitsCommits

Git avanzado

Page 20: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Preparando el commitAñadir nuevos archivos al índice (empezar a versionar): git add pathQuitar del índice (desversionar): git rm --cached pathAñadir modificaciones al staging area: git add pathVer las tres zonas: git statusQuitar modificaciones del staging area: git reset HEAD pathDeshacer cambios del Working Directory: git checkout -- pathBorrar archivos: git rm path

Git avanzado

Page 21: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Preparando el commitHacer el commit: git commit [-m "Mensaje"]Evitar mensajes genéricos como "Cambios", "Nuevoarchivo", "Correcciones", "CSS", "Merge"...Modificar el último commit: git commit --amendNo hacer --amend si el commit ya se había subido alremoto

Git avanzado

Page 22: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Preparando el commit

Simulación Working Directory -> Stage -> RepositorioSimulación commits y referenciasSimulación detached HEAD

Git avanzado

Page 23: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El commit

Hash SHA-1Autor / commiteadorFechaMensajePadre/s

Git avanzado

Page 24: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El log

git log [rama] para ver el histórico de commitsgit log --branches para ver el log de todas las ramasReferencias en el logVer el log compacto con git log --onelineVer bifurcaciones con git log --graphVer un commit con git show

Git avanzado

Page 25: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El log

Cómo referenciar a un commitPor su nombre: hash SHA-1Por su posición respecto al HEAD: HEAD^, HEAD^2... HEAD~, HEAD~2...Por su posición en el listado de reflog: HEAD@{n}

Git avanzado

Page 26: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El log

Saltar a otro commit o rama con git checkoutBorrar commits con git resetVer el histórico de HEADs con git reflogCulpar con git blame pathApartar cambios provisionalmente con git stash

git stash [push -m "Mensaje"]git stash listgit stash show stash@{n} -vgit stash apply [stash@{n}]git stash pop [stash@{n}]git stash drop [stash@{n}]

Git avanzado

Page 27: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

ConflictosConflictos

Git avanzado

Page 28: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Cuando hay dos versiones de código y Git no puededecidir cuál es la definitivaDiferencias en formato del archivo (tabulaciones,codificación, saltos de línea...)Pueden aparecer en cualquier operación que impliquefusión de código: merge, rebase, cherry-pick, pullSiempre que aparezcan conflictos, primero lanzar gitstatusGit espera a que resolvamos los conflictos y le demos laorden de cerrar la operaciónLos conflictos se delimitan por marcas en los archivos

Conflictos

Git avanzado

Page 29: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Cuando hay dos versiones de código y Git no puededecidir cuál es la definitivaDiferencias en formato del archivo (tabulaciones,codificación, saltos de línea...)Pueden aparecer en cualquier operación que impliquefusión de código: merge, rebase, cherry-pick, pullSiempre que aparezcan conflictos, primero lanzar gitstatusGit espera a que resolvamos los conflictos y le demos laorden de cerrar la operaciónLos conflictos se delimitan por marcas en los archivos

Conflictos

Git avanzado

<<<<<<< HEAD ↑ // Código del commit o rama // adonde apunta el HEAD ↓ ======= ↑ // Código del commit o rama // que estoy intentando fusionar con HEAD ↓ >>>>>>> develop

Page 30: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 31: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 32: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 33: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 34: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 35: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Conflictos

Git avanzado

Page 36: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Si queremos resolverlos a mano, editamos el texto,borramos las marcas y dejamos el código definitivo.Para usar una interfaz gráfica específica para resolverconflictos: git mergetoolEjemplo: configurar KDiff3 git config --global merge.tool kdiff3 git config --global mergetool.kdiff3.path "C:/ProgramFiles/KDiff3/kdiff3.exe"

Conflictos

Git avanzado

Page 37: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Si queremos resolverlos a mano, editamos el texto,borramos las marcas y dejamos el código definitivo.Para usar una interfaz gráfica específica para resolverconflictos: git mergetoolEjemplo: configurar KDiff3 git config --global merge.tool kdiff3 git config --global mergetool.kdiff3.path "C:/ProgramFiles/KDiff3/kdiff3.exe"

Conflictos

Git avanzado

Page 38: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Una vez resueltos los conflictos, se lo comunicamos a gitmediante git add pathPara terminar la fusión en un merge o en un pull: git commitPara terminar la fusión en un rebase: git rebase --continuePara terminar la fusión en un cherry-pick: git cherry-pick --continue

Conflictos

Git avanzado

Page 39: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

BranchingBranching

Git avanzado

Page 40: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas

Git avanzado

Page 41: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas

ReferenciaLa rama masterListar ramasCrear una rama con git branchIr a una rama con git checkoutCrear rama e ir a ella con git checkout -bBorrar una rama con git branch -dRenombrar una rama con git branch -m

Git avanzado

Page 42: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas - merge

Git avanzado

Page 43: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Fusionar ramasVolcar el trabajo de una rama en otraObjetivo: que una rama tenga los commits de otraFast forward: no crea un nuevo commitMerge a tres bandas: crea un nuevo commitConflictos: lanzar siempre git statusSimulación

Ramas - merge

Git avanzado

Page 44: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas - rebase

Git avanzado

Page 45: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas - rebase

Aplicar una rama al final de otraVolcar el trabajo de una rama en otraObjetivo: que una rama tenga los commits de otraNo crea un nuevo commitConflictos por pasos: lanzar siempre git statusNo hacer rebase si ya se ha subido la rama al remotoSimulación

Git avanzado

Page 46: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas - cherry-pick

Aplicar un commit aislado a una ramaNo se aplican los commits anterioresModificador -x para que añada al mensaje "Cherry-picked from XXXX"Conflictos: lanzar siempre git status

Git avanzado

Page 47: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Ramas - mover referencias

git branch -f nombre_rama [commit]git reset commit --hardSi sólo queremos avanzar la referencia de una ramahasta un commit más avanzado: git mergerama_destino

Git avanzado

Page 48: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El modelo git flow

master branchdevelop branchfeature branch

bugfix branchhotfix branchrelease branch

Git avanzado

Page 49: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El modelo git flow

master branchdevelop branchfeature branch

bugfix branchhotfix branchrelease branch

Git avanzado

Page 50: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

El programa git flow

 (en Windows ya viene instalado conGit)Empezar a usar git flow en un repositorio: git flow initIniciar rama: git flow tipo_rama start nombre_ramaCerrar rama: git flow finish

Instalación

Git avanzado

Page 51: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

RepositoriosRepositoriosremotosremotos

Git avanzado

Page 52: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Servidores GIT - repositorios remotos

/ Team Foundation Server

GitHubBitbucketGitLabAzure DevOps

Git avanzado

Page 53: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Repositorios remotos

Clonar un repositorio remoto: git clone URL [directorio]Los remotes: el remote originAñadir un remote con git remote addRenombrar un remote con git remote renameBorrar un remote con git remote removeCambiar la URL de un remote con git remote set-urlTracking branch git branch --set-upstream-to nombre_remote/nombre_ramaVer ramas trackeadas: git remote show nombre_remote

Git avanzado

Page 54: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Repositorios remotos

Enviar cambios al repositorio remoto: git push nombre_remote nombre_ramaTrackear la rama al hacer el push: git push -u nombre_remote nombre_ramaSincronizar mi copia local del remoto con git fetchTraer cambios del remoto con git mergeTraer cambios del remoto con git rebasegit fetch + git merge = git pullgit fetch + git rebase = git pull --rebaseSubir tags: git push --tags

Git avanzado

Page 55: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Repositorios remotos

Borrar ramas del remotoMarcar ramas remotas borradas con git fetch --pruneConfigurar prune por defecto: git config [--global] fetch.prune trueVer lo que voy a enviar en el push: git diff origin/master master

Git avanzado

Page 56: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Interfaces gráficasInterfaces gráficas

Git avanzado

Page 57: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

Git GUI y gitk (instaladas con Git)

Git avanzado

Page 58: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

Git GUI y gitk (instaladas con Git)

Git avanzado

Page 59: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

TortoiseGit

Git avanzado

Page 60: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

SourceTree

Git avanzado

Page 61: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

GitKraken

Git avanzado

Page 62: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

Plugin para EclipseEGit

Git avanzado

Page 63: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

GUI para Git

Team Explorer de Visual Studio

Git avanzado

Page 64: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

SubmódulosSubmódulos

Git avanzado

Page 65: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Submódulos

Para cuando hay jerarquía de proyectos/módulos

Git avanzado

Page 66: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Submódulos

Añadir un submódulo al módulo padre:git submodule add URL

Clonar un módulo padre con sus submódulos:Método 1: git clone URL --recurse-submodulesMétodo 2: git clone URL git submodule init git submodule update

Git avanzado

Actualizar submódulos a la última versión:git submodule update --remote

Page 67: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Pull RequestsPull Requests

Git avanzado

Page 68: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Pull Requests

En equipos grandesEl repositorio remoto tiene permisos de sólo lecturaen la rama developLos miembros no pueden mergear sus ramas adevelopSe sube la rama propia de feature y se solicita elmerge a través de la interfaz del servidorHay un encargado (o varios) de revisar las peticionesde PR, y de realizar el merge de las ramas a develop

Git avanzado

Page 69: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Pull Requests

En equipos grandesEl repositorio remoto tiene permisos de sólo lecturaen la rama developLos miembros no pueden mergear sus ramas adevelopSe sube la rama propia de feature y se solicita elmerge a través de la interfaz del servidorHay un encargado (o varios) de revisar las peticionesde PR, y de realizar el merge de las ramas a develop

Git avanzado

Page 70: Git avanzado - Mario González, formador y desarrollador web · 2019-10-01 · git fetch + git rebase = git pull --rebase Subir tags: git push --tags Git avanzado. Repositorios remotos

Links

Documentación oficial de GitLibro Pro GitGenerador de .gitignoreArtículo sobre Git FlowExplicación de git resetSubGitCapítulo de Pro Git sobre submódulosCómo encontrar cosas en GitPosts sobre Git en el blog

Git avanzado