introducing git version control into your team
DESCRIPTION
Introducing Git version control into your team. Mark Groves [email protected] @mgroves84 . Agenda. Introduction What is Git? Git 101 Enabling Team Development Short vs. Long Lived Branches Deploying with Git Your Org uses TFS? Tools/Resources. WHO AM I?. Mark Groves - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/1.jpg)
patterns & practices Symposium 2013
Introducing Git version control into your team
Mark [email protected]
@mgroves84
![Page 2: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/2.jpg)
Symposium 2013
Agenda Introduction What is Git? Git 101 Enabling Team Development Short vs. Long Lived Branches Deploying with Git Your Org uses TFS? Tools/Resources
![Page 3: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/3.jpg)
WHO AM I?Mark GrovesPrincipal Program ManagerDeveloper Division
![Page 4: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/4.jpg)
![Page 5: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/5.jpg)
![Page 6: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/6.jpg)
History
![Page 7: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/7.jpg)
HistoryCreated by Linus Torvalds for work on the Linux kernel ~2005
![Page 8: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/8.jpg)
HistoryCreated by Linus Torvalds for work on the Linux kernel ~2005Some of the companies that use git:
![Page 9: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/9.jpg)
What is Git?
![Page 10: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/10.jpg)
Git is aDistributedVersion Control System
![Page 11: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/11.jpg)
OR
![Page 12: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/12.jpg)
Git is a
DirectoryContent Management System
![Page 13: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/13.jpg)
Git is a
history storage system
Tree
![Page 14: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/14.jpg)
Git is a
content trackerStupid
![Page 15: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/15.jpg)
How ever you think about it…
![Page 16: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/16.jpg)
How ever you think about it…
Git is SUPER cool
![Page 17: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/17.jpg)
DistributedEveryone has the complete history
![Page 18: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/18.jpg)
Distributed
Everything is done offline
…except push/pull
Everyone has the complete history
![Page 19: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/19.jpg)
Distributed
Everything is done offlineEveryone has the complete history
No central authority
…except by convention
![Page 20: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/20.jpg)
Distributed
Everything is done offlineEveryone has the complete history
No central authorityChanges can be shared without a server
![Page 21: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/21.jpg)
Centralized VC vs. Distributed VC
Central Server Remote Server
![Page 22: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/22.jpg)
Branching
![Page 23: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/23.jpg)
BranchingForget what you know from Central VC(…TFS, SVN, Perforce...)
![Page 24: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/24.jpg)
BranchingForget what you know from Central VCGit branch is “Sticky Note” on a graph node
![Page 25: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/25.jpg)
BranchingForget what you know from Central VCGit branch is “Sticky Note” on a graph nodeAll branch work takes place within the same folder within your file system.
![Page 26: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/26.jpg)
BranchingForget what you know from Central VCGit branch is “Sticky Note” on the graphAll branch work takes place within the same folder within your file system. When you switch branches you are moving the “Sticky Note”
![Page 27: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/27.jpg)
InitializationC:\> mkdir CoolProjectC:\> cd CoolProjectC:\CoolProject > git initInitialized empty Git repository in C:/CoolProject/.gitC:\CoolProject > notepad README.txtC:\CoolProject > git add .C:\CoolProject > git commit -m 'my first commit'[master (root-commit) 7106a52] my first commit 1 file changed, 1 insertion(+) create mode 100644 README.txt
![Page 28: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/28.jpg)
Branches Illustrated
masterA
> git commit –m ‘my first commit’
![Page 29: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/29.jpg)
Branches Illustrated
master
> git commit (x2)
A B C
![Page 30: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/30.jpg)
Branches Illustrated
bug123
master
> git checkout –b bug123
A B C
![Page 31: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/31.jpg)
Branches Illustrated
master
> git commit (x2)
A B CD E
bug123
![Page 32: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/32.jpg)
Branches Illustrated
master
> git checkout master
A B CD E
bug123
![Page 33: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/33.jpg)
Branches Illustrated
bug123
master
> git merge bug123
A B C D E
![Page 34: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/34.jpg)
Branches Illustrated
master
> git branch -d bug123
A B C D E
![Page 35: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/35.jpg)
Branches Illustrated
masterA B C D E
F Gbug45
6
![Page 36: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/36.jpg)
Branches Illustrated
masterA B C D E
F Gbug45
6> git checkout master
![Page 37: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/37.jpg)
Branches Illustrated
masterA B C D E
F G
> git merge bug456
H
bug456
![Page 38: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/38.jpg)
Branches Illustrated
masterA B C D E
F G
> git branch -d bug456
H
![Page 39: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/39.jpg)
Branches Illustrated
masterA B C D E
F Gbug45
6
![Page 40: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/40.jpg)
Branches Illustrated
masterA B C D E
> git rebase master
F’ G’ bug45
6
![Page 41: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/41.jpg)
Branches Illustrated
masterA B C D E
> git checkout master> git merge bug456
F’ G’ bug45
6
![Page 42: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/42.jpg)
Branching Review
![Page 43: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/43.jpg)
Branching ReviewQuick and Easy to create ‘Feature’ Branches
![Page 44: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/44.jpg)
Branching Review
Local branches are very powerfulQuick and Easy to create ‘Feature’ Branches
![Page 45: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/45.jpg)
Branching Review
Local branches are very powerfulQuick and Easy to create ‘Feature’ BranchesRebase is not scary
![Page 46: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/46.jpg)
Software is a Team Sport
![Page 47: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/47.jpg)
Sharing commits
My Local Repo
Tom’s Repo
Tracey’s Repo
Matt’s Repo
A B C
A B C A B C
A B C
![Page 48: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/48.jpg)
Adding a Remote
![Page 49: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/49.jpg)
Sharing commits
My Local Repo
Tom’s Repo
Tracey’s Repo
Matt’s Repo
A B C
A B C A B C
A B C
Remote RepoA B C
D
D
D
D
D
![Page 50: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/50.jpg)
Setting up a Remote
![Page 51: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/51.jpg)
Setting up a RemoteAdding a remote to an existing local repoC:\CoolProject > git remote add origin
https://git01.codeplex.com/coolprojectC:\CoolProject > git remote -vorigin https://git01.codeplex.com/coolproject (fetch)origin https://git01.codeplex.com/coolproject (push)
![Page 52: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/52.jpg)
Setting up a RemoteClone will auto setup the remote
C:\> git clone https://git01.codeplex.com/coolprojectCloning into 'coolproject'...remote: Counting objects: 3, done.remote: Total 3 (delta 0), reused 0 (delta 0)Unpacking objects: 100% (3/3), done.C:\> cd .\coolprojectC:\CoolProject> git remote -vorigin https://git01.codeplex.com/coolproject (fetch)origin https://git01.codeplex.com/coolproject (push)
![Page 53: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/53.jpg)
Setting up a RemoteName remotes what you want
![Page 54: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/54.jpg)
Setting up a RemoteName remotes what you wantOrigin is only a convention
![Page 55: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/55.jpg)
Branches Illustrated
Amaster
B C D Ebug12
3
![Page 56: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/56.jpg)
Branches Illustrated
Amaster
origin/master
B C D Ebug12
3
![Page 57: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/57.jpg)
Branches Illustrated
AB C D E
master
bug123
origin/master
![Page 58: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/58.jpg)
Branches Illustrated
AB C D E
master
bug123
F G
origin/master
origin/master
![Page 59: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/59.jpg)
Branches Illustrated
AB C D E
master
bug123
> git checkout master
origin/master
![Page 60: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/60.jpg)
Branches Illustrated
AB C D E
master
bug123
F G
> git pull origin
origin/master
![Page 61: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/61.jpg)
Pull = Fetch + MergeFetch - updates your local copy of the remote branch
Pull essentially does a fetch and then runs the merge in one step.
![Page 62: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/62.jpg)
Branches Illustrated
AB C D E
master
bug123
F G
origin/master
![Page 63: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/63.jpg)
Branches Illustrated
AB C D E
master
bug123
F G
> git checkout bug123
origin/master
![Page 64: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/64.jpg)
Branches Illustrated
AB’
C’
D’
E’
master
bug123
F G
> git rebase master
origin/master
![Page 65: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/65.jpg)
Branches Illustrated
AB’
C’
D’
E’
master
bug123
F G
> git checkout master
origin/master
![Page 66: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/66.jpg)
Branches Illustrated
Amaster
bug123
F G
> git merge bug123
B’
C’
D’
E’
origin/master
![Page 67: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/67.jpg)
Branches Illustrated
Amaster
F G
> git push origin
B’
C’
D’
E’ bug12
3
origin/master
![Page 68: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/68.jpg)
PushPushes your changes upstream
Git will reject pushes if newer changes exist on remote.
Good practice: Pull then Push
![Page 69: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/69.jpg)
Branches Illustrated
Amaster
F G B’
C’
D’
E’ bug12
3
origin/master
![Page 70: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/70.jpg)
Branches Illustrated
Amaster
F G
> git branch -d bug123
B’
C’
D’
E’
origin/master
![Page 71: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/71.jpg)
Adding a Remote ReviewAdding a remote makes it easy to share
Pulling from the remote often helps keep you up to date
![Page 72: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/72.jpg)
Short vs. Long-Lived BranchesLocal branches are short lived
![Page 73: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/73.jpg)
Short vs. Long-Lived BranchesLocal branches are short livedStaying off master keeps merges simple
![Page 74: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/74.jpg)
Short vs. Long-Lived BranchesLocal branches are short livedStaying off master keeps merges simpleEnables working on several changes at once
![Page 75: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/75.jpg)
Short vs. Long-Lived BranchesLocal branches are short livedStaying off master keeps merges simpleEnables working on several changes at onceCreate
Commit
Merge
Delete
![Page 76: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/76.jpg)
Short vs. Long-Lived BranchesGreat for multi-version work
![Page 77: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/77.jpg)
Short vs. Long-Lived BranchesGreat for multi-version workFollow same rules as Master
![Page 78: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/78.jpg)
Short vs. Long-Lived BranchesGreat for multi-version workFollow same rules as Master…Story branches
![Page 79: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/79.jpg)
Short vs. Long-Lived BranchesGreat for multi-version workFollow same rules as Master…Story branchesIntegrate frequently
![Page 80: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/80.jpg)
Short vs. Long-Lived BranchesGreat for multi-version workFollow same rules as Master…Story branchesIntegrate frequentlyPushed to Remotes
![Page 81: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/81.jpg)
Branches Illustrated
Emaster
origin/master
![Page 82: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/82.jpg)
Branches Illustrated
Emaster
origin/master
develop
> git branch develop
![Page 83: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/83.jpg)
Branches Illustrated
Emaster
origin/master
develop
> git push origin develop
origin/develop
![Page 84: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/84.jpg)
Branches Illustrated
Emaster
origin/master
develop
> git checkout develop
origin/develop
![Page 85: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/85.jpg)
Branches Illustrated
Emaster
origin/master
F Gdevelo
p origin/develop
![Page 86: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/86.jpg)
Branches Illustrated
Emaster
origin/master
F Gdevelo
porigin/develop
> git pull origin develop
![Page 87: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/87.jpg)
Branches Illustrated
Emaster
origin/master
F Gdevelo
porigin/develop
> git checkout –b ideaidea
![Page 88: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/88.jpg)
Branches Illustrated
Emaster
origin/master
F Gdevelo
porigin/develop
> git commitidea
H
![Page 89: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/89.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop idea
HI
master
develop
![Page 90: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/90.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop idea
H
master
develop
> git pull (at least daily)
I
![Page 91: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/91.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop idea
H
master
> git checkout develop
I
develop
![Page 92: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/92.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop idea
H
master
> git merge idea (fast forward merge)
I
develop
![Page 93: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/93.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop
H
master
> git branch –d idea
I
develop
![Page 94: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/94.jpg)
Branches Illustrated
E
origin/master
F Gorigin/
develop
H
master
> git push origin develop
I
develop
![Page 95: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/95.jpg)
Merge Flow vs. Rebase Flow
E
origin/master
F Gorigin/
develop
H
master
> git push origin develop
I
develop
![Page 96: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/96.jpg)
Branches Illustrated – Merge Flow
E
origin/master
F Gorigin/
develop
H
master
> git checkout master
I
develop
![Page 97: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/97.jpg)
Branches Illustrated – Merge Flow
E
origin/master
F Gorigin/
develop
H
master
> git merge develop
I
develop
J
![Page 98: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/98.jpg)
Branches Illustrated – Merge Flow
E
origin/master
F Gorigin/
develop
H
master
> git push origin
I
develop
J
![Page 99: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/99.jpg)
Branches Illustrated – Rebase Flow
E
origin/master
F Gorigin/
develop
H
master
> git checkout master
I
develop
![Page 100: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/100.jpg)
Branches Illustrated – Rebase Flow
E
origin/master
F Gorigin/
develop
Hmaster
> git rebase develop
I’develo
p
I
![Page 101: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/101.jpg)
Branches Illustrated – Rebase Flow
E
origin/master
F Gorigin/
develop
Hmaster
> git push origin
I’develo
p
![Page 102: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/102.jpg)
Rebase FlowE
origin/master
F Gorigin/
develop
Hmaster
I’develo
p
E
origin/master
F Gorigin/
develop
H
masterI
develop
J
Merge Flow
![Page 103: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/103.jpg)
Short vs. Long-Lived BranchesGreat for multi-version workFollow same rules as Master
…use Story branchesDefine your conventions
What branches do you want to share?
Branch per environment?
![Page 104: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/104.jpg)
Deploying with Git
![Page 105: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/105.jpg)
Deploying with GitDeveloper “FTP”
![Page 106: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/106.jpg)
Deploying with GitDeveloper “FTP”Additional Branches pointing at:
![Page 107: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/107.jpg)
Deploying with GitDeveloper FTPAdditional Branches pointing at:
Test, Staging , Production
![Page 108: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/108.jpg)
Deploying with GitDeveloper FTPAdditional Branches pointing at:
Test, Staging , ProductionPost Commit Hooks Automate deployments
![Page 109: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/109.jpg)
Cloud Providers – Git SupportAppHarborHerokuNodejitsuWindows Azure… to name a few
![Page 110: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/110.jpg)
Simple Azure Deploy
![Page 111: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/111.jpg)
![Page 112: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/112.jpg)
![Page 113: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/113.jpg)
![Page 114: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/114.jpg)
![Page 115: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/115.jpg)
![Page 116: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/116.jpg)
![Page 117: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/117.jpg)
![Page 118: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/118.jpg)
![Page 119: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/119.jpg)
![Page 120: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/120.jpg)
![Page 121: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/121.jpg)
C:\CoolProject > git remote add azure https://[email protected]/coolproject.gitC:\CoolProject > git remote -vazure https://[email protected]/coolproject.git (fetch)azure https://[email protected]/coolproject.git (push)origin https://git01.codeplex.com/coolproject (fetch)origin https://git01.codeplex.com/coolproject (push)C:\CoolProject > git push azure masterCounting objects: 3, done.Writing objects: 100% (3/3), 226 bytes, done.Total 3 (delta 0), reused 0 (delta 0)remote: New deployment received.remote: Updating branch 'master'.remote: Updating submodules.remote: Preparing deployment for commit id '7106a52771'.remote: Preparing files for deployment.remote: Deployment successful.To https://[email protected]/coolproject.git * [new branch] master -> master
![Page 122: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/122.jpg)
![Page 123: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/123.jpg)
Git DeploymentSimple workflow
![Page 124: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/124.jpg)
Git DeploymentSimple workflowAdd Hooks to deploy on Commit
![Page 125: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/125.jpg)
Git DeploymentSimple workflowAdd Hooks to deploy on CommitCan get more advanced
![Page 126: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/126.jpg)
Git DeploymentSimple workflowAdd Hooks to deploy on CommitCan get more advancedAdd Build machines, push on success
![Page 127: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/127.jpg)
Your Org uses TFS?
![Page 128: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/128.jpg)
Your Org uses TFS? Sure Use Git-TFLocal workflow with Git
![Page 129: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/129.jpg)
Your Org uses TFS? Sure Use Git-TFLocal workflow with GitPush to TFS as a Remote
![Page 130: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/130.jpg)
Your Org uses TFS? Sure Use Git-TFLocal workflow with GitPush to TFS as a RemoteMulti-Platform and Open Source
![Page 131: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/131.jpg)
Your Org uses TFS? Sure Use Git-TFLocal workflow with GitPush to TFS as a RemoteMulti-Platform and Open Sourcehttp://gittf.codeplex.com
![Page 132: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/132.jpg)
Individual Developer WorkflowC:\CoolProject > git tf clone http://myserver:8080/tfs $/TeamProjectA/Main Make changes to the file in the Git repoC:\CoolProject > git commit -a -m "commit one" (commit changes locally) Make more changesC:\CoolProject > git commit -a -m "commit two"C:\CoolProject > git tf pull --rebaseC:\CoolProject > git tf checkin
![Page 133: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/133.jpg)
Git-TF for larger teamsTFS
Tom’s Repo
Tracey’s Repo
Matt’s Repo
A B C A B C A B C
Shared Git RepoA B C
git tf clone
git push
git clone git clone
![Page 134: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/134.jpg)
Git-TFLocal workflow with GitPush to TFS as a RemoteMulti-Platform and Open Sourcehttp://gittf.codeplex.com
![Page 136: Introducing Git version control into your team](https://reader035.vdocuments.mx/reader035/viewer/2022062315/568164c8550346895dd6e0ad/html5/thumbnails/136.jpg)
Tools / ResourcesPro Git (Book) http://www.git-scm.com/book
TortoiseGit (with TortoiseMerge) http://code.google.com/p/tortoisegitMsysgit (includes git-bash) http://code.google.com/p/msysgit
Posh-Git (for PowerShell users) http://github.com/dahlbyk/posh-git
GitScc (Visual Studio integration) http://gitscc.codeplex.com/
Windows Git Credential Store http://gitcredentialstore.codeplex.com/
GitHub for Windows http://windows.github.com/