Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Advanced Git - Paul Grayson
Search
Las Vegas Ruby Group
August 14, 2013
100
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Advanced Git - Paul Grayson
Las Vegas Ruby Group
August 14, 2013
More Decks by Las Vegas Ruby Group
See All by Las Vegas Ruby Group
Ruby ISO Standard - David Grayson
lvrug
0
180
Windows Automation - Howard Feldman
lvrug
0
120
Separating Your Application from Rails - Brian Hughes
lvrug
0
170
SWIG and Ruby - David Grayson
lvrug
0
110
Practical Object-Oriented Design in Ruby - Charles Jackson
lvrug
3
160
The Hamster Gem - Ryan Mulligan
lvrug
1
140
Varnish+Redis - Russ Smith
lvrug
1
150
Lambdas and Pops - Jan Hettich
lvrug
0
130
Making Good Use of Fonts - Russ Smith
lvrug
1
120
Featured
See All Featured
The Curse of the Amulet
leimatthew05
2
14k
Chasing Engaging Ingredients in Design
codingconduct
0
300
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Everyday Curiosity
cassininazir
0
310
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
520
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Discover your Explorer Soul
emna__ayadi
2
1.3k
How to build a perfect <img>
jonoalderson
1
6k
Transcript
Advanced Git: Multiple Branches and Servers Paul Grayson 2013-08-14
Simple Git • One server: “origin” • One branch: “master”
Demo: make a commit and push
Goal Use Git with multiple branches and servers, and know
what is going on.
What is a branch? A label for a state of
the repository - Current files (the commit) and all history. • List: git branch [-a] • Create: git branch <name> • Read: git show-branch, git log • Update: git commit • Delete: git branch -d <name>
Structure of Git history branch1 master
History of branch1 branch1 master
History of master branch1 master
branch1 --not master branch1 master
master --not branch1 branch1 master
Merging: the main point of branches branch1 master merge base
Checking changes on a branch • git log A --not
B • gitk A --not B • git merge-base A B • git log -1 commit • git log --oneline --graph • git diff A B
Multiple servers • Repositories on servers are called remotes -
but so are some other things, watch out! • Look at .git/config • git fetch server • git push server A:B
Git history with remotes branch1 master server/master origin/master
Git history with remotes branch1 master server/master origin/master LOCAL CACHED
COPIES!!!!
Checking remote branches git fetch Then use same techniques as
for branches • git log remote/A --not remote/B • gitk remote/A --not remote/B • git show-branch --merge-base ... • git log -1 commit • git log --oneline --graph • git diff remote/A remote/B
Putting it together: simple two-server workflow origin - code archive
server - production git showchanges branch1 git merge branch1 git push origin master git push origin :branch1 git push server master (on server) git merge master
Final touch: make it like Heroku using post-receive #!/bin/sh unset
GIT_DIR cd .. exec git merge master --ff