SlideShare una empresa de Scribd logo
1 de 19
Source versioning with GIT
p e n t a l

www.pentalog.fr

o g . f r
About Version Control
"Revision control, version control and source control (and an
aspect of software configuration management), is the
management of changes to documents, computer programs,
large web sites, and other collections of information. Changes
are usually identified by a number or letter code, termed the
"revision number", "revision level", or simply "revision". For
example, an initial set of files is "revision 1". When the first
change is made, the resulting set is "revision 2", and so on.
Each revision is associated with a timestamp and the person
making the change. Revisions can be compared, restored, and
with some types of files, merged."
Wikipedia.org

May 2013

pentalog.fr

2
Why Git ?
Benefits :
Distributed version control
Work offline
Everebody has a complete copy
Simple Branching
Commits quickly
Simple Merging

May 2013

pentalog.fr

3
Distributed VCS Example

May 2013

pentalog.fr

4
Customizing Git
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

May 2013

pentalog.fr

5
Starting a REPO
Setup :
~$ git init
~$ git add remote origin ssh://some-git-repository.git
~$ git checkout master

Clonning project :
~$ git clone ssh://some-git-repository.git

May 2013

pentalog.fr

6
Recording Changes to the Repository

May 2013

pentalog.fr

7
GIT working with index
Stash the changes in a dirty working directory away
●

$ git add file.txt

●

$ git add '*.txt'

●

$ git add 'webv6/*.inc'

●

$ git commit -m 'Some message for this cool
commit'

May 2013

pentalog.fr

8
GIT working with remote
Git can work with a set of repositories
$ git remote add remote_name remote_host
Manipulation with remote repositories
●

$ git pull origin master

//update local repository index from

tracked branch
●

$ git fetch remote_name -p

●

$ git merge origin/master

//update local repository index

//merge remote master to the local

branch
●

$ git push origin branch_name

//send local branch to

remote repository

May 2013

pentalog.fr

9
GIT branching

●

$ git checkout -b b_name source_branch

●

$ git branch (-r/-a)

●

$ git branch (-m / -M)

●

$ git branch (-d/-D)

●

$ git merge branch_name

●

$ git push origin :b_name

May 2013

pentalog.fr

10
Undoing Things
●

$ git reset octofamily/octodog.txt

//removing just from

stage
●

$ git reset --hard HEAD~5 (5 commits back)

●

$ git reset --hard HEAD

●

$ git checkout -- octocat.txt

●

$ git rm '*.txt'

May 2013

//reset all project to the HEAD state

//revert to the last commit/HEAD

//removed files are deleted and staged

pentalog.fr

11
Git useful commands

●

$ git status

●

$ git log

●

$ git diff HEAD (--staged)

●

$ git reflog

●

$ git cherry-pick

May 2013

//Show the working tree status

//Show commit logs

// diff between HEAD or Staged files

//show local history

//Apply the changes introduced by some existing commits

pentalog.fr

12
GIT Stash
Stash the changes in a dirty working directory away
●

$ git stash save

●

$ git stash apply

●

$ git stash pop

●

$ git stash list / show

●

$ git stash drop / clear

May 2013

pentalog.fr

13
Debugging with GIT

●

$ git blame file.php

●

$ git bisect start

●

$ git bisect bad

●

$ git bisect good SHA-1

May 2013

pentalog.fr

14
Tricks and Tips
●

Git UI colors :
[color]
ui = true
[color "branch"]
current = white
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
color.branch
color.diff
color.interactive
color.status
May 2013

pentalog.fr

15
Tricks and Tips
$ git push origin branch_name
$ git push origin HEAD =>
$ git push -u origin HEAD => git push
External Merge and Diff Tools
[merge]
tool = tortoise
[mergetool "tortoise"]
cmd = "TortoiseMerge.exe" -base:"$BASE"
-theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"
[diff]
external = "TortoiseMerge.exe" -base:"$2" -mine:"$5"

May 2013

pentalog.fr

16
Tricks and Tips
Git alias system :
[alias]
nb = checkout -b
rh = reset --hard HEAD
mm = merge origin/master
st = status
stat = status

May 2013

pentalog.fr

17
Hooks
special scripts that run for various source-control events to
enforce policy.
●

hooks are within the .git directory and not therefore under
source control, i.e., not cloned from remote repositories.
●

●

Client-side Hooks :
●
Pre-commit //inspect the snapshot that’s about to be
committed
●
Prepare-commit-msg // edit commit. Usefull for
automatic commits like mege commits
●
Commit-msg //use for some message validations
●
Post-commit //is used for notification or something
similar

Server-side Hooks

●

May 2013

pentalog.fr

18
www.pentalog.fr

Dmitrii Raev
draev@pentalog.fr

Más contenido relacionado

La actualidad más candente

La actualidad más candente (17)

Spe tech transfer luncheon nov 2014
Spe tech transfer luncheon nov 2014Spe tech transfer luncheon nov 2014
Spe tech transfer luncheon nov 2014
 
GTALUG Short Talk On Mercurial
GTALUG Short Talk On MercurialGTALUG Short Talk On Mercurial
GTALUG Short Talk On Mercurial
 
Git operation 101
Git operation 101Git operation 101
Git operation 101
 
Filling for macaroons
Filling for macaroonsFilling for macaroons
Filling for macaroons
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
key pada handpone samasung
key pada handpone samasungkey pada handpone samasung
key pada handpone samasung
 
Git essentials
Git essentialsGit essentials
Git essentials
 
PGXユーザ勉強会#12 G2GML開発進捗
PGXユーザ勉強会#12  G2GML開発進捗PGXユーザ勉強会#12  G2GML開発進捗
PGXユーザ勉強会#12 G2GML開発進捗
 
Why Everyone Needs Credit Repair
Why Everyone Needs Credit RepairWhy Everyone Needs Credit Repair
Why Everyone Needs Credit Repair
 
Type iv webquest_ok
Type iv webquest_okType iv webquest_ok
Type iv webquest_ok
 
Git, A Primer
Git, A PrimerGit, A Primer
Git, A Primer
 
Macaroons
MacaroonsMacaroons
Macaroons
 
Cueros%20 lazyload
Cueros%20 lazyloadCueros%20 lazyload
Cueros%20 lazyload
 
FLEXIcontent & FLEXIaccess presentation
FLEXIcontent & FLEXIaccess presentationFLEXIcontent & FLEXIaccess presentation
FLEXIcontent & FLEXIaccess presentation
 
João Rodrigues - be IN Bragança
João Rodrigues - be IN BragançaJoão Rodrigues - be IN Bragança
João Rodrigues - be IN Bragança
 
Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014
 
Kc A.Inco.Quilt
Kc A.Inco.QuiltKc A.Inco.Quilt
Kc A.Inco.Quilt
 

Similar a Source versioning with GIT

Get Good With Git
Get Good With GitGet Good With Git
Get Good With GitHoffman Lab
 
Getting some Git
Getting some GitGetting some Git
Getting some GitBADR
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Mizan Riqzia
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How tolanhuonga3
 
git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucketazwildcat
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
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 GitE Carter
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptuallyseungzzang Kim
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
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 controlBecky Todd
 

Similar a Source versioning with GIT (20)

Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucket
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
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
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
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
 
Git and Unity
Git and UnityGit and Unity
Git and Unity
 

Último

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Source versioning with GIT

  • 1. Source versioning with GIT p e n t a l www.pentalog.fr o g . f r
  • 2. About Version Control "Revision control, version control and source control (and an aspect of software configuration management), is the management of changes to documents, computer programs, large web sites, and other collections of information. Changes are usually identified by a number or letter code, termed the "revision number", "revision level", or simply "revision". For example, an initial set of files is "revision 1". When the first change is made, the resulting set is "revision 2", and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged." Wikipedia.org May 2013 pentalog.fr 2
  • 3. Why Git ? Benefits : Distributed version control Work offline Everebody has a complete copy Simple Branching Commits quickly Simple Merging May 2013 pentalog.fr 3
  • 4. Distributed VCS Example May 2013 pentalog.fr 4
  • 5. Customizing Git $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com May 2013 pentalog.fr 5
  • 6. Starting a REPO Setup : ~$ git init ~$ git add remote origin ssh://some-git-repository.git ~$ git checkout master Clonning project : ~$ git clone ssh://some-git-repository.git May 2013 pentalog.fr 6
  • 7. Recording Changes to the Repository May 2013 pentalog.fr 7
  • 8. GIT working with index Stash the changes in a dirty working directory away ● $ git add file.txt ● $ git add '*.txt' ● $ git add 'webv6/*.inc' ● $ git commit -m 'Some message for this cool commit' May 2013 pentalog.fr 8
  • 9. GIT working with remote Git can work with a set of repositories $ git remote add remote_name remote_host Manipulation with remote repositories ● $ git pull origin master //update local repository index from tracked branch ● $ git fetch remote_name -p ● $ git merge origin/master //update local repository index //merge remote master to the local branch ● $ git push origin branch_name //send local branch to remote repository May 2013 pentalog.fr 9
  • 10. GIT branching ● $ git checkout -b b_name source_branch ● $ git branch (-r/-a) ● $ git branch (-m / -M) ● $ git branch (-d/-D) ● $ git merge branch_name ● $ git push origin :b_name May 2013 pentalog.fr 10
  • 11. Undoing Things ● $ git reset octofamily/octodog.txt //removing just from stage ● $ git reset --hard HEAD~5 (5 commits back) ● $ git reset --hard HEAD ● $ git checkout -- octocat.txt ● $ git rm '*.txt' May 2013 //reset all project to the HEAD state //revert to the last commit/HEAD //removed files are deleted and staged pentalog.fr 11
  • 12. Git useful commands ● $ git status ● $ git log ● $ git diff HEAD (--staged) ● $ git reflog ● $ git cherry-pick May 2013 //Show the working tree status //Show commit logs // diff between HEAD or Staged files //show local history //Apply the changes introduced by some existing commits pentalog.fr 12
  • 13. GIT Stash Stash the changes in a dirty working directory away ● $ git stash save ● $ git stash apply ● $ git stash pop ● $ git stash list / show ● $ git stash drop / clear May 2013 pentalog.fr 13
  • 14. Debugging with GIT ● $ git blame file.php ● $ git bisect start ● $ git bisect bad ● $ git bisect good SHA-1 May 2013 pentalog.fr 14
  • 15. Tricks and Tips ● Git UI colors : [color] ui = true [color "branch"] current = white local = yellow remote = green [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold color.branch color.diff color.interactive color.status May 2013 pentalog.fr 15
  • 16. Tricks and Tips $ git push origin branch_name $ git push origin HEAD => $ git push -u origin HEAD => git push External Merge and Diff Tools [merge] tool = tortoise [mergetool "tortoise"] cmd = "TortoiseMerge.exe" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED" [diff] external = "TortoiseMerge.exe" -base:"$2" -mine:"$5" May 2013 pentalog.fr 16
  • 17. Tricks and Tips Git alias system : [alias] nb = checkout -b rh = reset --hard HEAD mm = merge origin/master st = status stat = status May 2013 pentalog.fr 17
  • 18. Hooks special scripts that run for various source-control events to enforce policy. ● hooks are within the .git directory and not therefore under source control, i.e., not cloned from remote repositories. ● ● Client-side Hooks : ● Pre-commit //inspect the snapshot that’s about to be committed ● Prepare-commit-msg // edit commit. Usefull for automatic commits like mege commits ● Commit-msg //use for some message validations ● Post-commit //is used for notification or something similar Server-side Hooks ● May 2013 pentalog.fr 18