Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Git 201
Dimitris Tsironis
May 31, 2013
Technology
0
130
Git 201
Branching Models basic, Merging & how Github's pull request work
Dimitris Tsironis
May 31, 2013
Tweet
Share
More Decks by Dimitris Tsironis
See All by Dimitris Tsironis
tsironis
0
120
tsironis
1
79
tsironis
2
160
tsironis
0
190
tsironis
4
87
tsironis
1
59
tsironis
2
340
tsironis
4
140
tsironis
2
140
Other Decks in Technology
See All in Technology
awsbelaraby
2
120
vkbaba
0
110
noir_neo
0
120
saoritakita
0
340
clustervr
0
200
ocise
0
120
shimacos
2
310
sakon310
4
4.2k
soachr
1
150
comucal
PRO
0
410
minamizaki
0
560
kyonmm
1
2k
Featured
See All Featured
keathley
17
630
bermonpainter
342
26k
michaelherold
225
8.5k
roundedbygravity
84
7.8k
eileencodes
113
25k
holman
461
280k
skipperchong
7
660
ddemaree
274
31k
ammeep
656
54k
maltzj
500
36k
davidbonilla
69
3.5k
marktimemedia
6
330
Transcript
Git 201 FreeFriday @ Teipir
Real quick...
Dimitris Tsironis Front-end Engineer at BugSense, JavaScript lover || hater,
Open-source & (Coffee)Script addict, Technology afficcionado
Previously on Free Fridays...
How can we work more effectively in a team?
Introducing Branching have multiple versions of the same project work
async & simultaneously safer & more clean way to do things very “cheap” branches
Git This is where the Git magic is happening!
creating a branch $ git branch <new-branch-name> # Creates a
new branch $ git checkout <new-branch-name> # Switch to new branch $ git branch # Check your local branches
creating a branch #2 # Creates a new branch and
switches to it immediately $ git checkout -b <new-branch-name>
Now, you can code as hard as you can!
Cool story, bro! But, how can we move our code
to our main branch and continue with our lives?
Merging Merge two branches Keep the chances you want to
keep You’re in control It’s easier in Git than in other VCS
merging a local branch $ git checkout <dest-branch> # Switch
to destination $ git merge <branch-name> # Merge the specified branch $ git log # Check if everything is fine
Once you’ve finished... You should do some housekeeping!
deleting a branch # Deletes branch, but keeps commits $
git branch -d <branch-name> # Force deletes everything, both branch and its commits $ git branch -D <branch-name> # USE WISELY!!
The Github way How Github handles branches & merging
Branches on Github Nothing special here Push your branches on
Github Has some awesome tools for branches
pushing to Github # Push branch on Github $ git
push origin <branch-name>
Pull Requests A nice, Web 2.0 way to handle merges,
branch and working in a team
Pull requests Promoting collaboration Encouraging open source contributions (fork) Discussing
features & changes on the go Merge without hassle and delete the branch
The real power is in the details! Let’s see...
Pull requests: reloaded Discussion for almost everything Can be created
before coding starts You have a timeline history of commits Forum-like functionality lots of integrations and extra tools
Extra tig (apt-get install tig, brew install tig) Github Help
Git basics presentation Git documentation
And, as always, practice, practice, PRACTICE!
Thanks! @tsironakos