SlideShare une entreprise Scribd logo
1  sur  26
SOURCE CONTROL
15 years ago... blog of the guy who would go
onto co-found Stack Overflow
l1. Do you use source control?
l...if you don't have source control, you're going to
stress out trying to get programmers to work
together. Programmers have no way to know what
other people did.
lMistakes can't be rolled back easily. The other
neat thing about source control systems is that the
source code itself is checked out on every
programmer's hard drive -- I've never heard of a
project using source control that lost a lot of code.
Many people's first introduction to the concept:
MS Word, Track changes - 2004
A history of source control
http://codicesoftware.blogspot.com/2010/11/version-control-timeline.html
Summary
lSource Control / Revision Control / Version
Control – tools used to help manage and track
changes in text files (ie source code)
lGit – a source control tool, written by Linus
Torvalds that we will be learning today
lGithub - A website, which makes it easy to work
collaboratively on git repositories. Bitbucket is
similar
Recap
lUse source control
lIt has been “best practices” for 15+ years
lUse source control
lEven if it's just you, use source control
3 things to help you understand Git
lHashing
lDiffs
lDirected Acyclic Graphs
Hashes
lConvert any-length strings into (shorter) fixed
sized strings.
lUseful for hash tables, cryptography, data
transmission and many other uses.
l$ echo "Hello world" | md5sum
lf0ef7081e1539ac00ef5b761b4fb01b3 -
Try:
lCopying files, hashing them.
lCreating files that are identical (not via copying),
hashing them
lModify files, hash them. Modify back.
lSee how it works?
Diff
lCreate a file with lots of lines
lMake a copy
lModify a line ½ way through
lRun diff file1.txt file2.txt
Directed Acyclic Graph
lDirected (ie the link is always the same direction,
ie between parent->child)
lAcyclic – no loops
lGraph – has nodes & edges
Install first...
Linux:
sudo apt-get install -y git meld
Git Hello World
git help
mkdir -p ~/localwork/git_tutorial
cd ~/localwork/git_tutorial
git init
(ls -l .git)
echo “Hello world” > hello.txt
git add hello.txt
git commit -m “initial commit”
Git Hello World
git log
Commit contains - Hash, date, message,
person/email.
(Modify hello.txt)
git add hello.txt
git diff # Shows what changed
git commit -m “modified”
git log
rm hello.txt
git diff
git checkout hello.txt # revert
cat hello.txt
git log
git checkout 851ae # Copy your 1
st
commit hash
cat hello.txt
git checkout master
cat hello.txt
Moving through time...
Branches (easy fast forward)
git branch feature
git checkout feature
(modify hello.txt)
git commit -a -m “modified in feature branch”
git log # has commit in feature branch
git checkout master
git log # doesn't have commit
git merge feature # Merge FROM feature into current (master)
Updating 219ddc3..70d4bfa
Fast-forward
hello.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
git branch
git branch -d feature # Delete feature
git log --graph
Branches (with auto merge)
(make hello.txt have lots of lines, and commit)
git branch feature
git checkout feature
(modify hello.txt on top lines)
git commit -a -m “modified in feature branch”
git checkout master
(Modify hello.txt on bottom lines)
git commit -a -m “modified in master”
git merge feature # auto-merges
git log --graph
Blame
Who did this??!
git blame hello.txt
Branches (with manual merge)
git branch my_branch
git checkout my_branch
(modify hello.txt)
git commit -a -m “modified in my_branch”
git checkout master
(Modify hello.txt on SAME lines)
git commit -a -m “modified in master”
git merge my_branch # can't do it
cat hello.txt
git mergetool # Visual tool to do it
git log --graph
Remote repositories
lClone
lPull
lPush
lIf a remote won't accept my push, 99% of the time
pull, merge, commit, push will fix it.
Git ecosystem
lGithub
lBitbucket
lSmartGit (GUI)

Contenu connexe

Tendances

Tendances (20)

Git advanced
Git advancedGit advanced
Git advanced
 
Git training with Devaamo
Git training with DevaamoGit training with Devaamo
Git training with Devaamo
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Geecon11 - Git: a Gentle InTroduction
Geecon11 -  Git: a Gentle InTroductionGeecon11 -  Git: a Gentle InTroduction
Geecon11 - Git: a Gentle InTroduction
 
Git basics
Git basicsGit basics
Git basics
 
Git in Eclipse
Git in EclipseGit in Eclipse
Git in Eclipse
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroduction
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
Git basics
Git basicsGit basics
Git basics
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at Eclipse
 
Knolx master-slides
Knolx master-slidesKnolx master-slides
Knolx master-slides
 
Demo
DemoDemo
Demo
 
git & GitHub workshop
git & GitHub workshopgit & GitHub workshop
git & GitHub workshop
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
 
GIT - DUG Antwerp
GIT - DUG AntwerpGIT - DUG Antwerp
GIT - DUG Antwerp
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to Git
 

Similaire à Workshop on Source control, git merge walkthroughs

Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
Git 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsGit 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsIan Walls
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Celestine Omin
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-DevelopersAll Things Open
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-DevelopersJohn Anderson
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)chenghlee
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developersDmitry Guyvoronsky
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Git for developers
Git for developersGit for developers
Git for developersHacen Dadda
 

Similaire à Workshop on Source control, git merge walkthroughs (20)

Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
Git 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsGit 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizations
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
 
3 Git
3 Git3 Git
3 Git
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git introduction
Git introductionGit introduction
Git introduction
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Git hub
Git hubGit hub
Git hub
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git 101
Git 101Git 101
Git 101
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Git for developers
Git for developersGit for developers
Git for developers
 

Dernier

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Dernier (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Workshop on Source control, git merge walkthroughs

  • 2. 15 years ago... blog of the guy who would go onto co-found Stack Overflow
  • 3. l1. Do you use source control? l...if you don't have source control, you're going to stress out trying to get programmers to work together. Programmers have no way to know what other people did. lMistakes can't be rolled back easily. The other neat thing about source control systems is that the source code itself is checked out on every programmer's hard drive -- I've never heard of a project using source control that lost a lot of code.
  • 4. Many people's first introduction to the concept: MS Word, Track changes - 2004
  • 5. A history of source control http://codicesoftware.blogspot.com/2010/11/version-control-timeline.html
  • 6.
  • 7.
  • 8. Summary lSource Control / Revision Control / Version Control – tools used to help manage and track changes in text files (ie source code) lGit – a source control tool, written by Linus Torvalds that we will be learning today lGithub - A website, which makes it easy to work collaboratively on git repositories. Bitbucket is similar
  • 9. Recap lUse source control lIt has been “best practices” for 15+ years lUse source control lEven if it's just you, use source control
  • 10.
  • 11. 3 things to help you understand Git lHashing lDiffs lDirected Acyclic Graphs
  • 12. Hashes lConvert any-length strings into (shorter) fixed sized strings. lUseful for hash tables, cryptography, data transmission and many other uses. l$ echo "Hello world" | md5sum lf0ef7081e1539ac00ef5b761b4fb01b3 -
  • 13. Try: lCopying files, hashing them. lCreating files that are identical (not via copying), hashing them lModify files, hash them. Modify back. lSee how it works?
  • 14. Diff lCreate a file with lots of lines lMake a copy lModify a line ½ way through lRun diff file1.txt file2.txt
  • 15. Directed Acyclic Graph lDirected (ie the link is always the same direction, ie between parent->child) lAcyclic – no loops lGraph – has nodes & edges
  • 17. Git Hello World git help mkdir -p ~/localwork/git_tutorial cd ~/localwork/git_tutorial git init (ls -l .git) echo “Hello world” > hello.txt git add hello.txt git commit -m “initial commit”
  • 18. Git Hello World git log Commit contains - Hash, date, message, person/email.
  • 19. (Modify hello.txt) git add hello.txt git diff # Shows what changed git commit -m “modified” git log rm hello.txt git diff git checkout hello.txt # revert cat hello.txt
  • 20. git log git checkout 851ae # Copy your 1 st commit hash cat hello.txt git checkout master cat hello.txt Moving through time...
  • 21. Branches (easy fast forward) git branch feature git checkout feature (modify hello.txt) git commit -a -m “modified in feature branch” git log # has commit in feature branch git checkout master git log # doesn't have commit git merge feature # Merge FROM feature into current (master) Updating 219ddc3..70d4bfa Fast-forward hello.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) git branch git branch -d feature # Delete feature git log --graph
  • 22. Branches (with auto merge) (make hello.txt have lots of lines, and commit) git branch feature git checkout feature (modify hello.txt on top lines) git commit -a -m “modified in feature branch” git checkout master (Modify hello.txt on bottom lines) git commit -a -m “modified in master” git merge feature # auto-merges git log --graph
  • 23. Blame Who did this??! git blame hello.txt
  • 24. Branches (with manual merge) git branch my_branch git checkout my_branch (modify hello.txt) git commit -a -m “modified in my_branch” git checkout master (Modify hello.txt on SAME lines) git commit -a -m “modified in master” git merge my_branch # can't do it cat hello.txt git mergetool # Visual tool to do it git log --graph
  • 25. Remote repositories lClone lPull lPush lIf a remote won't accept my push, 99% of the time pull, merge, commit, push will fix it.