SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Exprimiendo Git
Sobre mi

@ialcazar
http://israelalcazar.com
Cuña publicitaria

Curso de Git
16 – 17 Diciembre en Madrid

http://bit.ly/curso-git
Movember
Iniciativa de lucha contra el cáncer
de próstata
http://es.movember.com
First of all…

Clear your mind
GIT BASIS
History
1972: Source Code Control System (SCCS): Closed source,
free with Unix
1982: Revision Control System (RCS) : Cross platform.
Open Source. More features and faster.
They only could work with one file at the same time
1986-1990: Concurrent Versions System (CVS):
Concurrent users working on the same file. Open Source.
History
2000: Apache Subversion. Snapshot of the directory not
just the file. Transactional commits.
2000: BitKeeper SCM. Closed source, proprietary.
Distributed version control.
The community version was free. Used for source code of
the Linux kernel from 2002-2005
April 2005: The community version not free anymore
Git origin

It was born in 2005, developed by the kernel linux
team, leaded by Linus Torvalds.
Tries to improve BitKeeper.
What is a DVCS

They can share code
A programmer,
a repository

A programmer,
a repository

A programmer,
a repository

Everyone has a local repository
GIT INTERNALS (I)
Internal Areas

Git has the following areas:
Staging Area / Index

Intermediate zone where next commit is prepared.
File Status Lifecycle

Each file in your working directory can be in one of
two states: tracked or untracked.
Tracked files are files that were in the last
snapshot; they can be unmodified, modified, or
staged.
Untracked files are everything else.
File Status Lifecycle

Tracked	
  
stashing

A great way to pause what you are currently
working on and come back to it later.
$ git stash: Stash your changes away
$ git stash apply: Bring work back
E.g: git stash apply stash@{1}
$ git stash list: List of stashes
stashing

$ git stash pop: apply the top stash
$ git stash drop <id>: Manually delete stashes
$ git stash clear: Delete al of the stored stashes.
Commands

- 
- 
- 
- 
- 
- 

git
git
git
git
git
git

stash list
stash save "mensaje”
stash pop
stash show stash@{0}
stash apply stash@{0}
diff stash@{0}
Example of use: stash

¡Stop	
  working	
  and	
  
fix	
  this	
  bug!	
  
Example of use: stash

¡Fu&%&/&/&	
  
mother!	
  
GIT INTERNALS (II)
HEAD

HEAD is a pointer that points to the current
branch.
When you change to a different branch, HEAD
changes to point to the new one.
The current HEAD is local to each repository,
and is therefore individual for each developer.
HEAD

Hands-on
$ cd .git
$ cat HEAD
ref: refs/heads/master
$ git checkout –b newFeature
$ cat HEAD
ref: refs/heads/newFeature
Double Dash --

You can use -- to:
§  Separate options from a list of arguments:
$ git diff –w master origin -- tools/Makefile

§  Separate an explicitly identify filenames
# Checkout the tag named “main.c”
$ git checkout main.c
#Checkout the file named “main.c”
$ git checkout -- main.c
Basic Flow: First Commit
Working	
  Area	
  

Index	
  

Local	
  Repository	
  

git	
  add	
  <files>	
  
git	
  commit	
  

git	
  rm	
  -­‐-­‐cached	
  <file>	
  
git	
  reset	
  HEAD	
  <file>	
  
REFS AND SYMREFS
Ref

§  A symbolic reference , or symref , is a name that
indirectly points to a Git object. It is still just a
ref.
§  Local topic branch names, remote tracking
branch names, and tag names are all refs.
Symrefs

HEAD
ORIG_HEAD
Symrefs

HEAD
Always refers to the most recent commit on the
current branch.
When you change branches, HEAD is updated to
refer to the new branch’s latest commit.
Symrefs

ORIG_HEAD
Certain operations, such as merge and reset,
record the previous version of HEAD in ORIG_HEAD
just prior to adjusting it to a new value.
You can use ORIG_HEAD to recover or revert to the
previous state or to make a comparison.
Relative Commit Names

Git provides mechanism for identifying a commit
relative to another reference:
^: One commit before (master^, master^^,
HEAD^,etc)
~: N commits before (master~2, HEAD~4)
Relative Commit Names

C	
  is	
  a	
  commit	
  
C^^	
  	
  
C~3	
  

C~1	
  	
  

C~2	
  

C^	
  	
  
	
  	
  	
  	
  	
  

git	
  show-­‐branch	
  -­‐-­‐more=35	
  

C	
  
COMMITS
What is a commit

A commit is used to record changes to a
repository.
When a commit occurs, Git records a “snapshot” of
the index and places that snapshot in the object
store.
Format

$ git commit -m “Message”
$ git commit -am “Message”
$ git commit -m “Message” <file>
$ git commit --amend
Example of use: --amend

Fixing a typo
Commit history

You can see the history of commits:
$ git log (same as git log HEAD)
$ git log <commit-name>: The log starts at the
named commit.
E.g: $ git log master
Commit history

Specify a commit range (since..until)
$ git log master~12..master~10
Show only commits for a path
$ git log -- <path>
E.g. git log -- README3.txt
Commit history

Show commits with a regular expression
$ git log --grep=‘reg-exp’
--no-merges: Removes merge commits
Show changes during a time
$ git log
--since
--before
--after=“2010-04-18”
FIXING COMMITS
Fixing commits Flow

1. Discard changes in a file in the index to the
copy in working directory
$ git checkout -- <files>

2. Reverting a file some commits before
$ git checkout <commit-id> file
Basic Flow: Reset

You can reset some status of your repository:
$ git reset
$ git reset HEAD <file>
$ git reset --soft <commit-id>
$ git reset --hard <commit-id>
$ git reset --mixed <commit-id>
Basic Flow: Reset
Working	
  Area	
  

Index	
  

Local	
  Repository	
  

git	
  add	
  <files>	
  
git	
  commit	
  

git	
  reset	
  -­‐-­‐soQ	
  HEAD^	
  
git	
  rm	
  -­‐-­‐cached	
  <file>	
  
git	
  reset	
  HEAD	
  <file>	
  
git	
  checkout	
  -­‐-­‐	
  <file>	
  

git	
  reset	
  -­‐-­‐mixed	
  HEAD^	
  
Revert
Undoes a committed snapshot but instead of removing the
commit appends a new commit undoing changes introduced by
the commit.
This prevents losing history from Git.

1	
  

2	
  

3	
  

4	
  

git revert <commit>
Revert vs Reset

Revert undoes a single commit, it does not “revert”
back to the previous state of a project.

1	
  

2	
  

3	
  

4	
  

git	
  revert	
  

1	
  

2	
  

3	
  

4	
  

git	
  reset	
  
Example of use: reset

Premature commits in a branch
Rebasing interactive

git rebase –i <commit-base>
Alter individual commits removing, splitting and
altering an existing series of commits.
Example of use

Squashing

Split

Change commits in your
past history
Preguntas

Israel	
  Alcázar	
  
	
  
	
  
@ialcazar	
  

Más contenido relacionado

La actualidad más candente

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
 
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 101615Brian K. Vagnini
 
Introduction to Apache Pig
Introduction to Apache PigIntroduction to Apache Pig
Introduction to Apache PigAnshul Bhatnagar
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemTommaso Visconti
 
Shell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationShell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationVCP Muthukrishna
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheetvartmp
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_pptMiraz Al-Mamun
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
 
File Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptFile Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptVCP Muthukrishna
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubDSC GVP
 
Bash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailBash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailVCP Muthukrishna
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaMila Frerichs
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performancesource{d}
 
Git for beginner
Git for beginnerGit for beginner
Git for beginnerTrung Huynh
 

La actualidad más candente (17)

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
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
 
Introduction to Apache Pig
Introduction to Apache PigIntroduction to Apache Pig
Introduction to Apache Pig
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
Shell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationShell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address Information
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
File Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptFile Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell Script
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Bash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailBash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMail
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambda
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performance
 
Git and github
Git and githubGit and github
Git and github
 
Git for beginner
Git for beginnerGit for beginner
Git for beginner
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 

Similar a Exprimiendo GIT

Similar a Exprimiendo GIT (20)

Git and Github
Git and GithubGit and Github
Git and Github
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
 
Git like a pro EDD18 - Full edition
Git like a pro EDD18 - Full editionGit like a pro EDD18 - Full edition
Git like a pro EDD18 - Full edition
 
Git training
Git trainingGit training
Git training
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
Git
GitGit
Git
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
 
Knolx master-slides
Knolx master-slidesKnolx master-slides
Knolx master-slides
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git basics 2
Git basics 2Git basics 2
Git basics 2
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
 

Más de betabeers

IONIC, el framework para crear aplicaciones híbridas multiplataforma
IONIC, el framework para crear aplicaciones híbridas multiplataformaIONIC, el framework para crear aplicaciones híbridas multiplataforma
IONIC, el framework para crear aplicaciones híbridas multiplataformabetabeers
 
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)betabeers
 
Blockchain: la revolución industrial de internet - Oscar Lage
Blockchain: la revolución industrial de internet - Oscar LageBlockchain: la revolución industrial de internet - Oscar Lage
Blockchain: la revolución industrial de internet - Oscar Lagebetabeers
 
Cloud Learning: la formación del siglo XXI - Mónica Mediavilla
Cloud Learning: la formación del siglo XXI - Mónica MediavillaCloud Learning: la formación del siglo XXI - Mónica Mediavilla
Cloud Learning: la formación del siglo XXI - Mónica Mediavillabetabeers
 
Desarrollo web en Nodejs con Pillars por Chelo Quilón
Desarrollo web en Nodejs con Pillars por Chelo QuilónDesarrollo web en Nodejs con Pillars por Chelo Quilón
Desarrollo web en Nodejs con Pillars por Chelo Quilónbetabeers
 
La línea recta hacia el éxito - Jon Torrado - Betabeers Bilbao
La línea recta hacia el éxito -  Jon Torrado - Betabeers BilbaoLa línea recta hacia el éxito -  Jon Torrado - Betabeers Bilbao
La línea recta hacia el éxito - Jon Torrado - Betabeers Bilbaobetabeers
 
6 errores a evitar si eres una startup móvil y quieres evolucionar tu app
6 errores a evitar si eres una startup móvil y quieres evolucionar tu app6 errores a evitar si eres una startup móvil y quieres evolucionar tu app
6 errores a evitar si eres una startup móvil y quieres evolucionar tu appbetabeers
 
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)Dev ops.continuous delivery - Ibon Landa (Plain Concepts)
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)betabeers
 
Introducción a scrum - Rodrigo Corral (Plain Concepts)
Introducción a scrum - Rodrigo Corral (Plain Concepts)Introducción a scrum - Rodrigo Corral (Plain Concepts)
Introducción a scrum - Rodrigo Corral (Plain Concepts)betabeers
 
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)betabeers
 
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)betabeers
 
Elemental, querido Watson - Caso de Uso
Elemental, querido Watson - Caso de UsoElemental, querido Watson - Caso de Uso
Elemental, querido Watson - Caso de Usobetabeers
 
Seguridad en tu startup
Seguridad en tu startupSeguridad en tu startup
Seguridad en tu startupbetabeers
 
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.betabeers
 
Buenas prácticas para la optimización web
Buenas prácticas para la optimización webBuenas prácticas para la optimización web
Buenas prácticas para la optimización webbetabeers
 
La magia de Scrum
La magia de ScrumLa magia de Scrum
La magia de Scrumbetabeers
 
Programador++ por @wottam
Programador++ por @wottamProgramador++ por @wottam
Programador++ por @wottambetabeers
 
RaspberryPi: Tu dispositivo para IoT
RaspberryPi: Tu dispositivo para IoTRaspberryPi: Tu dispositivo para IoT
RaspberryPi: Tu dispositivo para IoTbetabeers
 
Introducción al Big Data - Xabier Tranche - VIII Betabeers Bilbao 27/02/2015
 Introducción al Big Data - Xabier Tranche  - VIII Betabeers Bilbao 27/02/2015 Introducción al Big Data - Xabier Tranche  - VIII Betabeers Bilbao 27/02/2015
Introducción al Big Data - Xabier Tranche - VIII Betabeers Bilbao 27/02/2015betabeers
 
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015betabeers
 

Más de betabeers (20)

IONIC, el framework para crear aplicaciones híbridas multiplataforma
IONIC, el framework para crear aplicaciones híbridas multiplataformaIONIC, el framework para crear aplicaciones híbridas multiplataforma
IONIC, el framework para crear aplicaciones híbridas multiplataforma
 
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)
Servicios de Gestión de Datos en la Nube - Jaime Balañá (NetApp)
 
Blockchain: la revolución industrial de internet - Oscar Lage
Blockchain: la revolución industrial de internet - Oscar LageBlockchain: la revolución industrial de internet - Oscar Lage
Blockchain: la revolución industrial de internet - Oscar Lage
 
Cloud Learning: la formación del siglo XXI - Mónica Mediavilla
Cloud Learning: la formación del siglo XXI - Mónica MediavillaCloud Learning: la formación del siglo XXI - Mónica Mediavilla
Cloud Learning: la formación del siglo XXI - Mónica Mediavilla
 
Desarrollo web en Nodejs con Pillars por Chelo Quilón
Desarrollo web en Nodejs con Pillars por Chelo QuilónDesarrollo web en Nodejs con Pillars por Chelo Quilón
Desarrollo web en Nodejs con Pillars por Chelo Quilón
 
La línea recta hacia el éxito - Jon Torrado - Betabeers Bilbao
La línea recta hacia el éxito -  Jon Torrado - Betabeers BilbaoLa línea recta hacia el éxito -  Jon Torrado - Betabeers Bilbao
La línea recta hacia el éxito - Jon Torrado - Betabeers Bilbao
 
6 errores a evitar si eres una startup móvil y quieres evolucionar tu app
6 errores a evitar si eres una startup móvil y quieres evolucionar tu app6 errores a evitar si eres una startup móvil y quieres evolucionar tu app
6 errores a evitar si eres una startup móvil y quieres evolucionar tu app
 
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)Dev ops.continuous delivery - Ibon Landa (Plain Concepts)
Dev ops.continuous delivery - Ibon Landa (Plain Concepts)
 
Introducción a scrum - Rodrigo Corral (Plain Concepts)
Introducción a scrum - Rodrigo Corral (Plain Concepts)Introducción a scrum - Rodrigo Corral (Plain Concepts)
Introducción a scrum - Rodrigo Corral (Plain Concepts)
 
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)
Gestión de proyectos y consorcios internacionales - Iñigo Cañadas (GFI)
 
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)
Software de gestión Open Source - Odoo - Bakartxo Aristegi (Aizean)
 
Elemental, querido Watson - Caso de Uso
Elemental, querido Watson - Caso de UsoElemental, querido Watson - Caso de Uso
Elemental, querido Watson - Caso de Uso
 
Seguridad en tu startup
Seguridad en tu startupSeguridad en tu startup
Seguridad en tu startup
 
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.
Spark Java: Aplicaciones web ligeras y rápidas con Java, por Fran Paredes.
 
Buenas prácticas para la optimización web
Buenas prácticas para la optimización webBuenas prácticas para la optimización web
Buenas prácticas para la optimización web
 
La magia de Scrum
La magia de ScrumLa magia de Scrum
La magia de Scrum
 
Programador++ por @wottam
Programador++ por @wottamProgramador++ por @wottam
Programador++ por @wottam
 
RaspberryPi: Tu dispositivo para IoT
RaspberryPi: Tu dispositivo para IoTRaspberryPi: Tu dispositivo para IoT
RaspberryPi: Tu dispositivo para IoT
 
Introducción al Big Data - Xabier Tranche - VIII Betabeers Bilbao 27/02/2015
 Introducción al Big Data - Xabier Tranche  - VIII Betabeers Bilbao 27/02/2015 Introducción al Big Data - Xabier Tranche  - VIII Betabeers Bilbao 27/02/2015
Introducción al Big Data - Xabier Tranche - VIII Betabeers Bilbao 27/02/2015
 
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015
PAYTPV Plataforma Integral de Cobros - VIII Betabeers Bilbao 27/02/2015
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Exprimiendo GIT

  • 3. Cuña publicitaria Curso de Git 16 – 17 Diciembre en Madrid http://bit.ly/curso-git Movember Iniciativa de lucha contra el cáncer de próstata http://es.movember.com
  • 6. History 1972: Source Code Control System (SCCS): Closed source, free with Unix 1982: Revision Control System (RCS) : Cross platform. Open Source. More features and faster. They only could work with one file at the same time 1986-1990: Concurrent Versions System (CVS): Concurrent users working on the same file. Open Source.
  • 7. History 2000: Apache Subversion. Snapshot of the directory not just the file. Transactional commits. 2000: BitKeeper SCM. Closed source, proprietary. Distributed version control. The community version was free. Used for source code of the Linux kernel from 2002-2005 April 2005: The community version not free anymore
  • 8. Git origin It was born in 2005, developed by the kernel linux team, leaded by Linus Torvalds. Tries to improve BitKeeper.
  • 9. What is a DVCS They can share code A programmer, a repository A programmer, a repository A programmer, a repository Everyone has a local repository
  • 11. Internal Areas Git has the following areas:
  • 12. Staging Area / Index Intermediate zone where next commit is prepared.
  • 13. File Status Lifecycle Each file in your working directory can be in one of two states: tracked or untracked. Tracked files are files that were in the last snapshot; they can be unmodified, modified, or staged. Untracked files are everything else.
  • 15. stashing A great way to pause what you are currently working on and come back to it later. $ git stash: Stash your changes away $ git stash apply: Bring work back E.g: git stash apply stash@{1} $ git stash list: List of stashes
  • 16. stashing $ git stash pop: apply the top stash $ git stash drop <id>: Manually delete stashes $ git stash clear: Delete al of the stored stashes.
  • 17. Commands -  -  -  -  -  -  git git git git git git stash list stash save "mensaje” stash pop stash show stash@{0} stash apply stash@{0} diff stash@{0}
  • 18. Example of use: stash ¡Stop  working  and   fix  this  bug!  
  • 19. Example of use: stash ¡Fu&%&/&/&   mother!  
  • 21. HEAD HEAD is a pointer that points to the current branch. When you change to a different branch, HEAD changes to point to the new one. The current HEAD is local to each repository, and is therefore individual for each developer.
  • 22. HEAD Hands-on $ cd .git $ cat HEAD ref: refs/heads/master $ git checkout –b newFeature $ cat HEAD ref: refs/heads/newFeature
  • 23. Double Dash -- You can use -- to: §  Separate options from a list of arguments: $ git diff –w master origin -- tools/Makefile §  Separate an explicitly identify filenames # Checkout the tag named “main.c” $ git checkout main.c #Checkout the file named “main.c” $ git checkout -- main.c
  • 24. Basic Flow: First Commit Working  Area   Index   Local  Repository   git  add  <files>   git  commit   git  rm  -­‐-­‐cached  <file>   git  reset  HEAD  <file>  
  • 26. Ref §  A symbolic reference , or symref , is a name that indirectly points to a Git object. It is still just a ref. §  Local topic branch names, remote tracking branch names, and tag names are all refs.
  • 28. Symrefs HEAD Always refers to the most recent commit on the current branch. When you change branches, HEAD is updated to refer to the new branch’s latest commit.
  • 29. Symrefs ORIG_HEAD Certain operations, such as merge and reset, record the previous version of HEAD in ORIG_HEAD just prior to adjusting it to a new value. You can use ORIG_HEAD to recover or revert to the previous state or to make a comparison.
  • 30. Relative Commit Names Git provides mechanism for identifying a commit relative to another reference: ^: One commit before (master^, master^^, HEAD^,etc) ~: N commits before (master~2, HEAD~4)
  • 31. Relative Commit Names C  is  a  commit   C^^     C~3   C~1     C~2   C^               git  show-­‐branch  -­‐-­‐more=35   C  
  • 33. What is a commit A commit is used to record changes to a repository. When a commit occurs, Git records a “snapshot” of the index and places that snapshot in the object store.
  • 34. Format $ git commit -m “Message” $ git commit -am “Message” $ git commit -m “Message” <file> $ git commit --amend
  • 35. Example of use: --amend Fixing a typo
  • 36. Commit history You can see the history of commits: $ git log (same as git log HEAD) $ git log <commit-name>: The log starts at the named commit. E.g: $ git log master
  • 37. Commit history Specify a commit range (since..until) $ git log master~12..master~10 Show only commits for a path $ git log -- <path> E.g. git log -- README3.txt
  • 38. Commit history Show commits with a regular expression $ git log --grep=‘reg-exp’ --no-merges: Removes merge commits Show changes during a time $ git log --since --before --after=“2010-04-18”
  • 40. Fixing commits Flow 1. Discard changes in a file in the index to the copy in working directory $ git checkout -- <files> 2. Reverting a file some commits before $ git checkout <commit-id> file
  • 41. Basic Flow: Reset You can reset some status of your repository: $ git reset $ git reset HEAD <file> $ git reset --soft <commit-id> $ git reset --hard <commit-id> $ git reset --mixed <commit-id>
  • 42. Basic Flow: Reset Working  Area   Index   Local  Repository   git  add  <files>   git  commit   git  reset  -­‐-­‐soQ  HEAD^   git  rm  -­‐-­‐cached  <file>   git  reset  HEAD  <file>   git  checkout  -­‐-­‐  <file>   git  reset  -­‐-­‐mixed  HEAD^  
  • 43. Revert Undoes a committed snapshot but instead of removing the commit appends a new commit undoing changes introduced by the commit. This prevents losing history from Git. 1   2   3   4   git revert <commit>
  • 44. Revert vs Reset Revert undoes a single commit, it does not “revert” back to the previous state of a project. 1   2   3   4   git  revert   1   2   3   4   git  reset  
  • 45. Example of use: reset Premature commits in a branch
  • 46. Rebasing interactive git rebase –i <commit-base> Alter individual commits removing, splitting and altering an existing series of commits.
  • 47. Example of use Squashing Split Change commits in your past history
  • 48.
  • 49. Preguntas Israel  Alcázar       @ialcazar