Let’s Learn Git. No … · Git. No Excuses! [email protected] @mcdwayne on Twitter Slides at...
Transcript of Let’s Learn Git. No … · Git. No Excuses! [email protected] @mcdwayne on Twitter Slides at...
![Page 1: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/1.jpg)
Let’sLearn
Git.No
Excuses!
@mcdwayne on Twitter
Slides at mcdwayne.com
![Page 3: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/3.jpg)
Marketers and developers build, host,
and manage their most important websites on
Pantheon
![Page 4: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/4.jpg)
![Page 5: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/5.jpg)
![Page 6: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/6.jpg)
@mcdwayne
![Page 7: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/7.jpg)
@mcdwayne
Uploads DocV2.txt at 11:58 Uploads DocV2.txt at 11:59
![Page 8: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/8.jpg)
![Page 9: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/9.jpg)
Command+Z is not a strategy
![Page 10: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/10.jpg)
![Page 11: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/11.jpg)
![Page 12: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/12.jpg)
Git is a free and open source distributed version control system designed to handle everything from small to very large projects
with speed and efficiency.
![Page 13: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/13.jpg)
![Page 14: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/14.jpg)
Created by Linus Torvalds in 2005 for development of the Linux kernel
![Page 15: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/15.jpg)
Maintained since 2005 by Junio Hamano
![Page 16: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/16.jpg)
@mcdwayne
Knowledge Worker
Anyone working with items that will be saved, then
modified and saved again
NOT JUST FOR DEVS
![Page 17: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/17.jpg)
Basic idea:
The document is created
The document is saved
The document is edited
The changes are saved
![Page 18: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/18.jpg)
Keep track of every time modifications are saved.
Include a history of the state of the document before and after the modification.
Provide you, the author or editor, with the opportunity to add a note explaining the nature of each change.
https://premium.wpmudev.org/blog/git-for-wordpress-development/
![Page 19: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/19.jpg)
Really though:
The project is created
The project is saved
The project is edited
The project changes are saved
![Page 20: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/20.jpg)
The Basics Of Time Travel Git
![Page 21: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/21.jpg)
Graphical Based
![Page 22: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/22.jpg)
Everything is local...Everything
![Page 23: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/23.jpg)
Git is lightweight
![Page 24: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/24.jpg)
Git is NOT a backup tool
![Page 25: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/25.jpg)
There are a LOT of community resourcesAnd very well documented
![Page 26: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/26.jpg)
![Page 27: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/27.jpg)
@mcdwayne
https://git-scm.com
Download git for OSX
Download git for Windows
Download git for Linux
Install Git
![Page 28: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/28.jpg)
Git CLI
![Page 29: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/29.jpg)
Git GUI
![Page 30: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/30.jpg)
@mcdwayne
git initCreate a new repo locallyCreate a Repo
![Page 31: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/31.jpg)
@mcdwayne
git initCreate a new repo locallyCreate a Repo
![Page 32: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/32.jpg)
@mcdwayne
![Page 33: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/33.jpg)
@mcdwayne
git statusList which files are staged, unstaged, and untracked
See what is going on (you will use this often)
![Page 34: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/34.jpg)
@mcdwayne
git statusList which files are staged, unstaged, and untracked
See what is going on (you will use this often)
![Page 35: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/35.jpg)
@mcdwayne
![Page 36: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/36.jpg)
@mcdwayne
git add filenameAdd individual filesAdd files to the staging area
![Page 37: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/37.jpg)
@mcdwayne
git add filenameAdd individual filesAdd files to the staging area
![Page 38: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/38.jpg)
@mcdwayne
git add .Add all the filesAdd files to the staging area
![Page 39: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/39.jpg)
@mcdwayne
git add .Add all the filesAdd files to the staging area
![Page 40: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/40.jpg)
@mcdwayne
git commit -m “message”Make an official record of the change in your history
Commit things to the repository
![Page 41: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/41.jpg)
@mcdwayne
git commit -m “message”Make an official record of the change in your history
Commit things to the repository
![Page 42: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/42.jpg)
@mcdwayne
‘i’ to insert then esc‘:wq’ to write & quit
If you don’t use -m “message” you get dropped into vi editor
The vi editor - you will eventually run into it
![Page 43: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/43.jpg)
@mcdwayne
‘i’ to insert then esc‘:wq’ to write & quit
If you don’t use -m “message” you get dropped into vi editor
The vi editor - you will eventually run into it
![Page 44: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/44.jpg)
@mcdwayne
When you have modified a file, repeat add and commit
![Page 45: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/45.jpg)
@mcdwayne
git logDisplay entire commit historySee all changes over time
![Page 46: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/46.jpg)
@mcdwayne
git log (--oneline)Display entire commit historySee all changes over time
![Page 47: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/47.jpg)
@mcdwayne
git log (--oneline)Display entire commit historySee all changes over time
![Page 48: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/48.jpg)
@mcdwayne
git diffShow what changed whereSee all what changed in your working directory
![Page 49: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/49.jpg)
@mcdwayne
git diffShow what changed whereSee all what changed in your working directory
![Page 50: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/50.jpg)
@mcdwayne
![Page 51: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/51.jpg)
@mcdwayne
git revert <commit ID>Let’s undo a specific commitUndoing things (safe)
![Page 52: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/52.jpg)
@mcdwayne
git revert <commit ID>Let’s undo a specific commitUndoing things (safe)
![Page 53: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/53.jpg)
@mcdwayne
git revert <commit ID>Let’s undo a specific commit even reverts!
Undoing things (safe)
![Page 54: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/54.jpg)
@mcdwayne
git revert <commit ID>Let’s undo a specific commit even reverts!
Undoing things (safe)
![Page 55: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/55.jpg)
@mcdwayne
git reset --hard <commit ID>Let’s go backwards in time and forget everything after that point
Undoing things (dangerous)
![Page 56: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/56.jpg)
@mcdwayne
git reset --hard <commit ID>Let’s go backwards in time and forget everything after that point
Undoing things (dangerous)
![Page 57: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/57.jpg)
@mcdwayne
![Page 58: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/58.jpg)
@mcdwayne
Working with branches
![Page 59: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/59.jpg)
@mcdwayne
git branch (newBranchName)See what exists and create a new one
Working with branches
![Page 60: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/60.jpg)
@mcdwayne
git branch (newBranchName)See what exists and create a new one
Working with branches
![Page 61: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/61.jpg)
@mcdwayne
git checkout branchnameSwitch between branchesWorking with branches
![Page 62: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/62.jpg)
@mcdwayne
git checkout branchnameSwitch between branchesWorking with branches
![Page 63: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/63.jpg)
@mcdwayne
git branchYour changes in a branch are not reflected in ‘master’
Working with branches
![Page 64: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/64.jpg)
@mcdwayne
git branchYour changes in a branch are not reflected in ‘master’
Working with branches
![Page 65: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/65.jpg)
@mcdwayne
git merge branchToMergeInMerging branches, make sure you are on master first
Working with merging
![Page 66: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/66.jpg)
@mcdwayne
git merge branchToMergeInMerging branches, make sure you are on master first
Working with merging
![Page 67: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/67.jpg)
@mcdwayne
git merge branchToMergeInThis will happen sometimesChanges conflict, looks like this
Merge Conflicts
![Page 68: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/68.jpg)
@mcdwayne
git mergeGit tries to fix things and shows you where it went bad
Merge Conflicts
![Page 69: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/69.jpg)
@mcdwayne
git mergeGit tries to fix things and shows you where it went bad
Merge Conflicts
![Page 70: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/70.jpg)
@mcdwayne
git mergetoolThere are built tools you can have git run to help fix conflicts
Merge Conflicts
![Page 71: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/71.jpg)
@mcdwayne
Remote repositories
![Page 72: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/72.jpg)
@mcdwayne
Remote repositories
![Page 73: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/73.jpg)
@mcdwayne
![Page 74: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/74.jpg)
@mcdwayne
git remote add Name the remote (origin) and address of the online repo
Let’s add a remote repository
![Page 75: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/75.jpg)
@mcdwayne
git remote add Name the remote (origin) and address of the online repo
Let’s add a remote repository
![Page 76: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/76.jpg)
@mcdwayne
git remote add Name the remote (origin) and address of the online repo
Let’s add a remote repository
![Page 77: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/77.jpg)
@mcdwayne
git push Name the remote (origin) and name of branch (master)
Let’s push to a remote repository
git push origin master
git push origin branch
git push other-remote branch
![Page 78: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/78.jpg)
@mcdwayne
git push Name the remote (origin) and name of branch (master)
Let’s push to a remote repository
![Page 79: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/79.jpg)
@mcdwayne
git push Name the remote (origin) and name of branch (master)
Let’s push to a remote repository
![Page 80: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/80.jpg)
@mcdwayne
Editing on GithubUsing Github’s editor and pulling changes locally
Let’s pull changes into our repository
![Page 81: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/81.jpg)
@mcdwayne
git pullUsing Github’s editor and pulling changes locally
Let’s pull changes into our repository
![Page 82: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/82.jpg)
@mcdwayne
git pullUsing Github’s editor and pulling changes locally
Let’s pull changes into our repository
![Page 83: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/83.jpg)
@mcdwayne
git push Name the remote (origin) and name of branch (master)
Let’s push local back up again
![Page 84: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/84.jpg)
@mcdwayne
git push Name the remote (origin) and name of branch (master)
Let’s push local back up again
![Page 85: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/85.jpg)
@mcdwayne
git clone We just need to specify where from and it creates the folder
We can clone a copy locally from any remote repository
![Page 86: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/86.jpg)
@mcdwayne
git clone We just need to specify where from and it creates the folder
We can clone a copy locally from any remote repository
![Page 87: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/87.jpg)
@mcdwayne
This is is branching and collaboration in one conceptEnter the Pull Request!
![Page 88: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/88.jpg)
@mcdwayne
Enter the Pull Request!
![Page 89: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/89.jpg)
@mcdwayne
Anyone with push access to the repository can complete the merge. Normally this is assigned to the repo owner.
Repository
![Page 90: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/90.jpg)
@mcdwayne
git initgit statusgit addgit commitgit loggit diffgit revertgit reset git branchgit checkoutgit mergegit remotegit pushgit pullgit clone
What I memorized
![Page 91: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/91.jpg)
@mcdwayne
For everything else!
![Page 92: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/92.jpg)
@mcdwayne
Official Documents:https://git-scm.com/dochttps://guides.github.com/introduction/flow/
Articles I Like:https://calderaforms.com/2015/09/who-should-be-using-version-control-for-wordpress-development/https://premium.wpmudev.org/blog/git-for-wordpress-development/https://www.sitepoint.com/wordpress-version-control-git/http://www.makeuseof.com/tag/git-version-control-youre-developer/https://blog.wppusher.com/demystifying-git-for-wordpress-developers/https://wptavern.com/git-and-wordpress-3-tips-to-do-it-better
Cheat Sheets!https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheethttps://www.git-tower.com/blog/git-cheat-sheet/
Fixing things:https://sethrobertson.github.io/GitFixUm/fixup.htmlhttp://ohshitgit.com/
100s of ‘how to’ guides and docs
![Page 93: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/93.jpg)
![Page 95: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/95.jpg)
@mcdwayne on Twitter
Slides at: mcdwayne.com
Forward in timegit initgit statusgit addgit commitgit loggit diff
Back in timegit revertgit reset
Parallel universesgit branchgit checkoutgit merge
Collaboratinggit remotegit pushgit pullgit clone
![Page 96: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/96.jpg)
![Page 97: Let’s Learn Git. No … · Git. No Excuses! dwayne@pantheon.io @mcdwayne on Twitter Slides at mcdwayne.com Marketers and developers build, host, and manage their most important](https://reader036.fdocuments.us/reader036/viewer/2022090605/605ac95463227063f66de671/html5/thumbnails/97.jpg)
@mcdwayne on Twitter
Slides at: mcdwayne.com
Forward in timegit initgit statusgit addgit commitgit loggit diff
Back in timegit revertgit reset
Parallel universesgit branchgit checkoutgit merge
Collaboratinggit remotegit pushgit pullgit clone