Introducción a Git (Git 101)

27
Git 101 ıctor Orozco GuateJUG October 2, 2015

Transcript of Introducción a Git (Git 101)

Page 1: Introducción a Git (Git 101)

Git 101

V́ıctor Orozco

GuateJUG

October 2, 2015

Page 2: Introducción a Git (Git 101)

V́ıctor Orozco

I Developer (JVM/OpenSource Advocate)

I Ex-JUG Leader

I Consultor independiente(Nabenik)

I @tuxtor

I The J*

Page 3: Introducción a Git (Git 101)

Git (historia)

I DVCS

I Linus Torvalds (2005)

I Bitkeeper workflow

I ”The stupid content tracker

Page 4: Introducción a Git (Git 101)

SVN

Page 5: Introducción a Git (Git 101)

Git

Page 6: Introducción a Git (Git 101)

Git (caracteristicas)

I Soporte robusto a metodologias no lineales

I Compatibilidad con protocolos estandard (HTTPS, SSH)

I Eficiencia con grandes volumenes de datos

I Estandard criptografico de nombrado

I Modular, toolkit, GPLv2

Page 7: Introducción a Git (Git 101)

Git (caracteristicas)

I Soporte robusto a metodologias no lineales

I Compatibilidad con protocolos estandard (HTTPS, SSH)

I Eficiencia con grandes volumenes de datos

I Estandard criptografico de nombrado

I Modular, toolkit, GPLv2

Page 8: Introducción a Git (Git 101)

Git

Setup

Page 9: Introducción a Git (Git 101)

Git workflow

Creamos un repositorio

git init

Page 10: Introducción a Git (Git 101)

Git workflow

Copiamos un repositorio local

git checkout /path/to/repository

Copiamos un repositorio remoto

git checkout username@host:/path/to/repository

Page 11: Introducción a Git (Git 101)

Git workflow

Consiste en tres arboles

I Working directory

I Staging

I HEAD

Page 12: Introducción a Git (Git 101)

Git workflow

Ejemplo add & commit

git add <filename>

git commit -m "Creando mi primer archivo git"

Page 13: Introducción a Git (Git 101)

Git config

git config --global user.name <name>

git config --global user.email <email>

Page 14: Introducción a Git (Git 101)

Git workflow

Enviar a servidor remoto

I git push <remote> <branch>

I git remote add <remote> <url>

git remote add origin <server<

git push origin master

Page 15: Introducción a Git (Git 101)

Git branching

I Isolar caracteristicas entre si

I master es la rama predefinida

git checkout -b <branch>

git push origin <branch>

Page 16: Introducción a Git (Git 101)

Git merge

I Integrar caracteristicas desde una rama

I Rama actual = rama donde se integrara el cambio

git checkout master

git merge <branch>

git branch -d <branch>

Page 17: Introducción a Git (Git 101)

Git update

git pull //obtiene cambios remotos

git merge <branch>

Page 18: Introducción a Git (Git 101)

Git log

git log

git log --pretty=oneline

git log --graph --oneline --decorate --all

git log --name-status //archivos cambiados

Page 19: Introducción a Git (Git 101)

Git tagging

git tag 1.0.0 1b2e1d63ff

Page 20: Introducción a Git (Git 101)

Git replace

git checkout -- <filename>

Obtiene el ultimo HEAD, cambios en index y new file sonconservados

Page 21: Introducción a Git (Git 101)

Workflows

I Centralized

I Feature branch

I Gitflow

I Forking

Page 22: Introducción a Git (Git 101)

Centralized

Page 23: Introducción a Git (Git 101)

Feature branch

Page 24: Introducción a Git (Git 101)

Gitflow

Page 25: Introducción a Git (Git 101)

Forking

Page 26: Introducción a Git (Git 101)

Recursos

I Atlassian Git Tutorials

I Git School

Page 27: Introducción a Git (Git 101)

Gracias

I [email protected]

I http://vorozco.com

I http://github.com/tuxtor/slides

This work is licensed under a Creative CommonsAttribution-ShareAlike 3.0 Guatemala License.