SlideShare a Scribd company logo
Loading...git
whoami



        Rafa García

      Web developer
Administrador de Sistemas
Entusiasta del software libre
¡Encuesta rápida!
●
    ¿Quién NO está usando un SCM?
¡Encuesta rápida!
●
    ¿Quién NO está usando un SCM?
●
    ¿Subversion?
¡Encuesta rápida!
●
    ¿Quién NO está usando un SCM?
●
    ¿Subversion?
●
    ¿CVS? (¿todavía?)
¡Encuesta rápida!
●
    ¿Quién NO está usando un SCM?
●
    ¿Subversion?
●
    ¿CVS? (¿todavía?)
C'est la vie




Le Voyage Magnifique es obra de Debra Chow - http://vimeo.com/6846068
¿Qué es Git?
¿Qué es Git?




 Git sistema de control de versiones
      distribuido, open source,
diseñado para ser rápido y eficiente.
¿Por qué Git?
●
    Distribuido
●
    ¡Es muy rápido!
●
    Branching
●
    Workflows
●
    Una gran comunidad detrás
Configurar Git




By Twicepix - http://www.flickr.com/photos/twicepix/4288056667/
Configurar Git
$ git config --global user.name "Rafa G."
$ git config --global user.email "foo@domain.com"


# Extraball
$ git config --global color.ui auto
$ git config --global core.editor /usr/bin/vim
Crear repositorio
$ mkdir foo
$ cd foo/
~/foo$ git init
Initialized empty Git repository in ~/foo/.git/
Trabajando con Git
Estado del repositorio
$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use
"git add" to track)
Estado del repositorio
$ touch README
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git
add" to track)
Stage
$ git add README
Stage
$ git add README
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
# new file:    README
#
Commit
$ git commit -m 'First commit. Adelante
caminante!'
[master (root-commit) e3e4e54] First
commit. Adelante caminante!
 0 files changed, 0 insertions(+), 0
deletions(-)
create mode 100644 README
Ignorar ficheros
$ cat .gitignore
.bundle/
db/sphinx/*
log/**/*
log/*
tmp/**/*
tmp/*
.rvmrc
Deshaciendo cambios




    By Gaelx - http://www.flickr.com/photos/gaelx/2664672458/
Deshaciendo cambios
$ echo "Loadin$%&... Git" > README
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified:    README
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout README
$ git status
# On branch master
nothing to commit (working directory clean)
Deshaciendo cambios
$ echo "A not useful text" > README
$ git add .
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
# modified:    README
#
$ git reset HEAD README
Deshaciendo cambios
$ echo "Yeeeeeeeha" > README
$ git add .
$ git commit -m 'Upss this is FAIL'
$ git revert HEAD
Finished one revert.
[detached HEAD 19c6cb5] Revert "Upss this
is FAIL"
 1 files changed, 1 insertions(+), 1
deletions(-)
Deshaciendo cambios




    By Stan Lee
Deshaciendo cambios
$ git reset --hard HEAD^^^
# Que es lo mismo que...
$ git reset --hard HEAD~3
Deshaciendo cambios
$ git reset --hard HEAD^^^
# Que es lo mismo que...
$ git reset --hard HEAD~3


# O una versión mas light
$ git reset --soft HEAD^
Branch




By n8agrin - http://www.flickr.com/photos/n8agrin/2735063012/
Branch
# Creamos la rama
$ git branch loading
$ git checkout loading
Switched to branch 'loading'


# Extraball
$ git checkout -b loading
Switched to a new branch 'loading'
Branch
# Moverse por las ramas
$ git branch loading
$ git branch riojaparty
$ git checkout loading
Switched to branch 'loading'
$ git checkout riojaparty
Switched to branch 'riojaparty'
$ git checkout master
Switched to branch 'master'


# Extraball – Listado de ramas (man git-branch)
$ git branch
 loading
* master
 riojaparty
Branch
# Merge de ramas
$ git checkout riojaparty
# Commit some changes!
$ git checkout master
$ git merge riojaparty
Updating 6f190b0..a6e1f75
Fast-forward
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 riojaparty_talks.txt
Branch
$ git branch remove_me
$ git branch -d remove_me
Deleted branch remove_me (was a6e1f75).


# Extraball
# Borrar rama con cambios no "mergeados"
(man git-branch)
$ git branch -D remove_me
Tag
# Creando tags
$ git tag v1.0
$ git tag
v1.0
$ git tag beta1 HEAD^
$ git tag
beta1
v1.0
$ git tag beta2 HEAD~5
$ git tag
beta1
beta2
V1.0


# Borrando tags
$ git tag -d beta2
Deleted tag 'beta2' (was f379043)
Trabajando en equipo




     By Steve Punter - http://www.flickr.com/photos/spunter/2947192314
Trabajando en equipo
# Clonando un repositorio
$ git clone foo foo_clone
Initialized empty Git repository in ~/foo_clone/.git/
$ cd foo_clone
$ git remote
origin
$ git remote show origin
* remote origin
 Fetch URL: ~/foo
 Push URL: ~/foo
 HEAD branch (remote HEAD is ambiguous, may be one of the following):
  master
  riojaparty
 Remote branches:
  loading      tracked
  master       tracked
  riojaparty tracked
 Local branch configured for 'git pull':
  master merges with remote master
 Local ref configured for 'git push':
  master pushes to master (up to date)
Trabajando en equipo
$ git clone --bare foo foo.git
Initialized empty Git repository in ~/foo.git/


$ ls foo.git/
branches config description HEAD hooks
info objects packed-refs refs
Trabajando en equipo
# Enviando cambios al repositorio remoto
$ git clone foo.git foo_bare
# Realizamos cambios...
$ git push
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 250 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
To ~/foo.git
  c2d55e3..012f07d master -> master
Trabajando en equipo
# Actualizando nuestra copia local...
$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
From ~/foo
  a6e1f75..83a30a8 master       -> origin/master
Updating a6e1f75..83a30a8
Fast-forward
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 add_another_file.txt
Trabajando en equipo
# Enviando cambios a un repositorio remoto concreto
# Hacemos algunos cambios y entonces...
$ git push origin master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 265 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
To ../foo.git
  012f07d..0a5d1cd master -> master
Conflictos




By NWharry - http://www.flickr.com/photos/nightwing_26/5151831220/
Extras
●
    Stash
●
    Blame
●
    Bisect
●
    Ramas y tags remotos
●
    Workflows
●
    …
¡Gracias!




By woodleywonderworks - http://www.flickr.com/photos/wwworks/4759535950/
Enlaces
Git - http://git-scm.com/


Tutoriales y libros:
Git Immersion - http://gitimmersion.com/
Pro Git (Scott Chacon) - http://www.humbug.in/docs/pro-git-book-es/
Pragmatic Guide To Git - http://pragprog.com/titles/pg_git/pragmatic-guide-to-git


Pensamientos:
Joel on Software - http://www.joelonsoftware.com/items/2010/03/17.html


Presentaciones:
Git 101 - http://www.slideshare.net/chacon/git-101-presentation
The everyday developer's guide to version control with Git -
http://www.slideshare.net/erincarter/the-everyday-developers-guide-to-version-control-with-git
Git - http://www.slideshare.net/jnewland/git-512895
Git Started With Git - http://www.slideshare.net/qrush/git-started-with-git
Loading...git
Ad

More Related Content

What's hot (19)

Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
Ariejan de Vroom
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
Prakash Dantuluri
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
Miraz Al-Mamun
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
tmacwilliam
 
Git Real
Git RealGit Real
Git Real
Gong Haibing
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
SeongJae Park
 
Gittalk
GittalkGittalk
Gittalk
prtinsley
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
bryanbibat
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
 
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
Yoram Michaeli
 
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Codemotion
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Katie Sylor-Miller
 
slides.pdf
slides.pdfslides.pdf
slides.pdf
vidsvagi
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Eat my data
Eat my dataEat my data
Eat my data
Peng Zuo
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
timyates
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
Ariejan de Vroom
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
Miraz Al-Mamun
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
tmacwilliam
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
SeongJae Park
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
bryanbibat
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
 
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Codemotion
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Katie Sylor-Miller
 
slides.pdf
slides.pdfslides.pdf
slides.pdf
vidsvagi
 
Eat my data
Eat my dataEat my data
Eat my data
Peng Zuo
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
timyates
 

Viewers also liked (17)

Drupal
DrupalDrupal
Drupal
Hari K T
 
Pedro Acevedo
Pedro AcevedoPedro Acevedo
Pedro Acevedo
pedromartinacevedo
 
máy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
máy cắt tôn - máy chấn tôn - máy cắt rập giấy cartonmáy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
máy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
tranduyen76
 
¿Como fomentar y seleccionar estrategia locales de calidad?
¿Como fomentar y seleccionar estrategia locales de calidad?¿Como fomentar y seleccionar estrategia locales de calidad?
¿Como fomentar y seleccionar estrategia locales de calidad?
Carlos Romero Valiente
 
06 vo cam 2007
06 vo cam 200706 vo cam 2007
06 vo cam 2007
Hùng Lê
 
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Robert Bliss
 
Willem's PowerPoint
Willem's PowerPoint Willem's PowerPoint
Willem's PowerPoint
lcs56
 
Saopaulo
SaopauloSaopaulo
Saopaulo
daniel filho
 
Le due anfore
Le due anforeLe due anfore
Le due anfore
angelamericibs
 
Comunicados processo seletivo Ibiúna
Comunicados processo seletivo IbiúnaComunicados processo seletivo Ibiúna
Comunicados processo seletivo Ibiúna
Luana Maria Ferreira Fernandes
 
04 NETCOM G5 - COL Matchette
04 NETCOM G5 - COL Matchette04 NETCOM G5 - COL Matchette
04 NETCOM G5 - COL Matchette
USARMYNETCOM
 
Ldp leadership development - eng
Ldp   leadership development - engLdp   leadership development - eng
Ldp leadership development - eng
Mây Trắng
 
Luis Machín
Luis MachínLuis Machín
Luis Machín
javilafuente
 
Salute e ambiente lettera al sindaco di miane
Salute e ambiente   lettera al sindaco di mianeSalute e ambiente   lettera al sindaco di miane
Salute e ambiente lettera al sindaco di miane
Roberto de Noni
 
Khoa học và Sức khỏe trẻ em
Khoa học và Sức khỏe trẻ emKhoa học và Sức khỏe trẻ em
Khoa học và Sức khỏe trẻ em
TS DUOC
 
The Oral Side Of Sjögren Syndrome
The  Oral  Side Of  Sjögren  SyndromeThe  Oral  Side Of  Sjögren  Syndrome
The Oral Side Of Sjögren Syndrome
andreamrblog
 
máy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
máy cắt tôn - máy chấn tôn - máy cắt rập giấy cartonmáy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
máy cắt tôn - máy chấn tôn - máy cắt rập giấy carton
tranduyen76
 
¿Como fomentar y seleccionar estrategia locales de calidad?
¿Como fomentar y seleccionar estrategia locales de calidad?¿Como fomentar y seleccionar estrategia locales de calidad?
¿Como fomentar y seleccionar estrategia locales de calidad?
Carlos Romero Valiente
 
06 vo cam 2007
06 vo cam 200706 vo cam 2007
06 vo cam 2007
Hùng Lê
 
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Mar 30, 08 Am Giving That Pleases Jesus Lk 21.1 4
Robert Bliss
 
Willem's PowerPoint
Willem's PowerPoint Willem's PowerPoint
Willem's PowerPoint
lcs56
 
04 NETCOM G5 - COL Matchette
04 NETCOM G5 - COL Matchette04 NETCOM G5 - COL Matchette
04 NETCOM G5 - COL Matchette
USARMYNETCOM
 
Ldp leadership development - eng
Ldp   leadership development - engLdp   leadership development - eng
Ldp leadership development - eng
Mây Trắng
 
Salute e ambiente lettera al sindaco di miane
Salute e ambiente   lettera al sindaco di mianeSalute e ambiente   lettera al sindaco di miane
Salute e ambiente lettera al sindaco di miane
Roberto de Noni
 
Khoa học và Sức khỏe trẻ em
Khoa học và Sức khỏe trẻ emKhoa học và Sức khỏe trẻ em
Khoa học và Sức khỏe trẻ em
TS DUOC
 
The Oral Side Of Sjögren Syndrome
The  Oral  Side Of  Sjögren  SyndromeThe  Oral  Side Of  Sjögren  Syndrome
The Oral Side Of Sjögren Syndrome
andreamrblog
 
Ad

Similar to Loading...git (20)

Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
Ignacio Martín
 
Git & gitflow
Git & gitflowGit & gitflow
Git & gitflow
Nolifelover Earn
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Jedi Mind Tricks in Git
Jedi Mind Tricks in GitJedi Mind Tricks in Git
Jedi Mind Tricks in Git
Johan Abildskov
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
Jan Krag
 
Git basics
Git basicsGit basics
Git basics
Amit Sawhney
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
Mahmoud Said
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
Javier Lafora Rey
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
Khanh NL-bantoilatoi
 
Git
GitGit
Git
AddWeb Solution Pvt. Ltd.
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
Jan Krag
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Ad

More from Rafael García (7)

¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
¿Por qué Ruby? Descubre su expresividad (y peculiaridades)¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
Rafael García
 
Quiero ser informatico, ¿que hago?
Quiero ser informatico, ¿que hago?Quiero ser informatico, ¿que hago?
Quiero ser informatico, ¿que hago?
Rafael García
 
Jugando con gosu
Jugando con gosuJugando con gosu
Jugando con gosu
Rafael García
 
Loading... Ruby on Rails 3
Loading... Ruby on Rails 3Loading... Ruby on Rails 3
Loading... Ruby on Rails 3
Rafael García
 
Un Trocito De Google
Un Trocito De GoogleUn Trocito De Google
Un Trocito De Google
Rafael García
 
Taller de Capistrano
Taller de CapistranoTaller de Capistrano
Taller de Capistrano
Rafael García
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
Rafael García
 
¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
¿Por qué Ruby? Descubre su expresividad (y peculiaridades)¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
¿Por qué Ruby? Descubre su expresividad (y peculiaridades)
Rafael García
 
Quiero ser informatico, ¿que hago?
Quiero ser informatico, ¿que hago?Quiero ser informatico, ¿que hago?
Quiero ser informatico, ¿que hago?
Rafael García
 
Loading... Ruby on Rails 3
Loading... Ruby on Rails 3Loading... Ruby on Rails 3
Loading... Ruby on Rails 3
Rafael García
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
Rafael García
 

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 

Loading...git

  • 2. whoami Rafa García Web developer Administrador de Sistemas Entusiasta del software libre
  • 3. ¡Encuesta rápida! ● ¿Quién NO está usando un SCM?
  • 4. ¡Encuesta rápida! ● ¿Quién NO está usando un SCM? ● ¿Subversion?
  • 5. ¡Encuesta rápida! ● ¿Quién NO está usando un SCM? ● ¿Subversion? ● ¿CVS? (¿todavía?)
  • 6. ¡Encuesta rápida! ● ¿Quién NO está usando un SCM? ● ¿Subversion? ● ¿CVS? (¿todavía?)
  • 7. C'est la vie Le Voyage Magnifique es obra de Debra Chow - http://vimeo.com/6846068
  • 9. ¿Qué es Git? Git sistema de control de versiones distribuido, open source, diseñado para ser rápido y eficiente.
  • 10. ¿Por qué Git? ● Distribuido ● ¡Es muy rápido! ● Branching ● Workflows ● Una gran comunidad detrás
  • 11. Configurar Git By Twicepix - http://www.flickr.com/photos/twicepix/4288056667/
  • 12. Configurar Git $ git config --global user.name "Rafa G." $ git config --global user.email "[email protected]" # Extraball $ git config --global color.ui auto $ git config --global core.editor /usr/bin/vim
  • 13. Crear repositorio $ mkdir foo $ cd foo/ ~/foo$ git init Initialized empty Git repository in ~/foo/.git/
  • 15. Estado del repositorio $ git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track)
  • 16. Estado del repositorio $ touch README $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # README nothing added to commit but untracked files present (use "git add" to track)
  • 17. Stage $ git add README
  • 18. Stage $ git add README $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: README #
  • 19. Commit $ git commit -m 'First commit. Adelante caminante!' [master (root-commit) e3e4e54] First commit. Adelante caminante! 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 README
  • 20. Ignorar ficheros $ cat .gitignore .bundle/ db/sphinx/* log/**/* log/* tmp/**/* tmp/* .rvmrc
  • 21. Deshaciendo cambios By Gaelx - http://www.flickr.com/photos/gaelx/2664672458/
  • 22. Deshaciendo cambios $ echo "Loadin$%&... Git" > README $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: README # no changes added to commit (use "git add" and/or "git commit -a") $ git checkout README $ git status # On branch master nothing to commit (working directory clean)
  • 23. Deshaciendo cambios $ echo "A not useful text" > README $ git add . $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: README # $ git reset HEAD README
  • 24. Deshaciendo cambios $ echo "Yeeeeeeeha" > README $ git add . $ git commit -m 'Upss this is FAIL' $ git revert HEAD Finished one revert. [detached HEAD 19c6cb5] Revert "Upss this is FAIL" 1 files changed, 1 insertions(+), 1 deletions(-)
  • 25. Deshaciendo cambios By Stan Lee
  • 26. Deshaciendo cambios $ git reset --hard HEAD^^^ # Que es lo mismo que... $ git reset --hard HEAD~3
  • 27. Deshaciendo cambios $ git reset --hard HEAD^^^ # Que es lo mismo que... $ git reset --hard HEAD~3 # O una versión mas light $ git reset --soft HEAD^
  • 28. Branch By n8agrin - http://www.flickr.com/photos/n8agrin/2735063012/
  • 29. Branch # Creamos la rama $ git branch loading $ git checkout loading Switched to branch 'loading' # Extraball $ git checkout -b loading Switched to a new branch 'loading'
  • 30. Branch # Moverse por las ramas $ git branch loading $ git branch riojaparty $ git checkout loading Switched to branch 'loading' $ git checkout riojaparty Switched to branch 'riojaparty' $ git checkout master Switched to branch 'master' # Extraball – Listado de ramas (man git-branch) $ git branch loading * master riojaparty
  • 31. Branch # Merge de ramas $ git checkout riojaparty # Commit some changes! $ git checkout master $ git merge riojaparty Updating 6f190b0..a6e1f75 Fast-forward 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 riojaparty_talks.txt
  • 32. Branch $ git branch remove_me $ git branch -d remove_me Deleted branch remove_me (was a6e1f75). # Extraball # Borrar rama con cambios no "mergeados" (man git-branch) $ git branch -D remove_me
  • 33. Tag # Creando tags $ git tag v1.0 $ git tag v1.0 $ git tag beta1 HEAD^ $ git tag beta1 v1.0 $ git tag beta2 HEAD~5 $ git tag beta1 beta2 V1.0 # Borrando tags $ git tag -d beta2 Deleted tag 'beta2' (was f379043)
  • 34. Trabajando en equipo By Steve Punter - http://www.flickr.com/photos/spunter/2947192314
  • 35. Trabajando en equipo # Clonando un repositorio $ git clone foo foo_clone Initialized empty Git repository in ~/foo_clone/.git/ $ cd foo_clone $ git remote origin $ git remote show origin * remote origin Fetch URL: ~/foo Push URL: ~/foo HEAD branch (remote HEAD is ambiguous, may be one of the following): master riojaparty Remote branches: loading tracked master tracked riojaparty tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date)
  • 36. Trabajando en equipo $ git clone --bare foo foo.git Initialized empty Git repository in ~/foo.git/ $ ls foo.git/ branches config description HEAD hooks info objects packed-refs refs
  • 37. Trabajando en equipo # Enviando cambios al repositorio remoto $ git clone foo.git foo_bare # Realizamos cambios... $ git push Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 250 bytes, done. Total 2 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (2/2), done. To ~/foo.git c2d55e3..012f07d master -> master
  • 38. Trabajando en equipo # Actualizando nuestra copia local... $ git pull remote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. remote: Total 2 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (2/2), done. From ~/foo a6e1f75..83a30a8 master -> origin/master Updating a6e1f75..83a30a8 Fast-forward 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 add_another_file.txt
  • 39. Trabajando en equipo # Enviando cambios a un repositorio remoto concreto # Hacemos algunos cambios y entonces... $ git push origin master Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 265 bytes, done. Total 2 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (2/2), done. To ../foo.git 012f07d..0a5d1cd master -> master
  • 40. Conflictos By NWharry - http://www.flickr.com/photos/nightwing_26/5151831220/
  • 41. Extras ● Stash ● Blame ● Bisect ● Ramas y tags remotos ● Workflows ● …
  • 42. ¡Gracias! By woodleywonderworks - http://www.flickr.com/photos/wwworks/4759535950/
  • 43. Enlaces Git - http://git-scm.com/ Tutoriales y libros: Git Immersion - http://gitimmersion.com/ Pro Git (Scott Chacon) - http://www.humbug.in/docs/pro-git-book-es/ Pragmatic Guide To Git - http://pragprog.com/titles/pg_git/pragmatic-guide-to-git Pensamientos: Joel on Software - http://www.joelonsoftware.com/items/2010/03/17.html Presentaciones: Git 101 - http://www.slideshare.net/chacon/git-101-presentation The everyday developer's guide to version control with Git - http://www.slideshare.net/erincarter/the-everyday-developers-guide-to-version-control-with-git Git - http://www.slideshare.net/jnewland/git-512895 Git Started With Git - http://www.slideshare.net/qrush/git-started-with-git