SlideShare a Scribd company logo
Git Magic:
Versioning Files
  Like a Boss
  Tommy MacWilliam
   tmacwilliam@cs50.net
Today

• setting up like a boss
• basic git like a boss
• using branches like a boss
• reverting changes like a boss
• collaborating like a boss
Git is...
• “Git is distributed version control system
  focused on speed, effectivity and real-world
  usability on large projects”
  •   “distributed development”
  •   “non-linear development”
  •   “efficient handling of large projects”
  •   “cryptographic authentication of history”
Git is...
Git is...


Awesome.
Installing Git

• Windows: http://code.google.com/p/
  msysgit/
• OS X: http://code.google.com/p/git-osx-
  installer/
• Appliance: already installed!
Installing Git

root@appliance(~): git
usage: git [--version] [--exec-path[=<path>]] [--html-path]
       [-p|--paginate|--no-pager] [--no-replace-objects]
       [--bare] [--git-dir=<path>] [--work-tree=<path>]
       [-c name=value] [--help]
       <command> [<args>]
git config --global
user.name
“Tommy MacWilliam”
git config --global
user.email
tmacwilliam@cs50.net
Git Magic: Versioning Files like a Boss
git init
Commits

• snapshots of your project
• what your files look like at a given point
• single event in project history
Git Magic: Versioning Files like a Boss
git status
Git Magic: Versioning Files like a Boss
git add index.php
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
git add --all
git add --all
git add --all
git commit
Commit Messages

• short message describing what’s different in
  this commit
• add any new features?
• fix some bugs?
• break anything?
Commit Messages
Commit Messages


• http://www.commitlogsfromlastnight.com/
Git Magic: Versioning Files like a Boss
git commit -a -m
  “oh hi, mark!”
Git Magic: Versioning Files like a Boss
git log
5aeebab117b892fa42002146e4c62be676bc4621




b43b0ad1e8108e7ab870d7a54feac93ae8b8600e




461476587780aa9fa5611ea6dc3912c146a91760
Commit   5aeebab117b892fa42002146e4c62be676bc4621
  ID


         b43b0ad1e8108e7ab870d7a54feac93ae8b8600e




         461476587780aa9fa5611ea6dc3912c146a91760




HEAD
Git Magic: Versioning Files like a Boss
git show
git show b43b0
git init
git status
 git add



git commit
   git log
 git show
git init
git status
 git add



git commit
   git log
 git show
Branches
• non-linear development process
 • changes on one branch do not affect
    other branches
• crazy idea? make a branch
• didn’t work? delete the branch
• all done? merge the branch
Git Magic: Versioning Files like a Boss
git branch test
git branch test
git branch test
git checkout test
5aeeb




 b43b0




 46147




master
5aeeb
         git branch test



 b43b0      f862f




 46147      36223




master      test
Git Magic: Versioning Files like a Boss
git merge
5aeeb




 b43b0    f862f




 46147    36223




         git merge
 87aed


master    test
Git Magic: Versioning Files like a Boss
Like a boss.
Git Magic: Versioning Files like a Boss
git branch -D test
Merge vs. Rebase


• git merge: new commit, non-linear history
• git rebase: no new commit, linear history
5aeeb
         git branch test



 b43b0      f862f




 46147      36223




master      test
5aeeb




 b43b0



         git rebase

 46147                f862f   36223




master
Conflicts


• change in one branch can be incompatible
  with another
• git tries to resolve, but sometimes cannot
Conflict Resolution
int main(int argc, char** argv) {
   printf(“you invited all my friends”);
}

int main(int argc, char** argv) {
   printf(“good thinking!”);
}
Conflict Resolution

int main(int argc, char** argv) {
   <<<<<<< HEAD:file.c
   printf(“you invited all my friends”);
   =======
   printf(“good thinking!”);
   >>>>>>> f862f:file.c
}
git checkout
 git branch




 git merge
 git rebase
git checkout
 git branch




 git merge
 git rebase
git commit -m “oops.”
Git Magic: Versioning Files like a Boss
git revert b43b0
5aeeb




b43b0




46147
5aeeb




b43b0




46147



          git revert b43b0
 42bb4
(b43b0)
File-Specific Reverts

• git checkout -- index.php
 • replace with version in index
• git checkout b43b0 index.php
 • replace with version in commit b43b0
Git Magic: Versioning Files like a Boss
git reset --hard b43b0
Git Magic: Versioning Files like a Boss
git reflog
Git Magic: Versioning Files like a Boss
git bisect
Git Magic: Versioning Files like a Boss
Like a boss.
git revert
  git reset




git checkout
  git bisect
git revert
  git reset




git checkout
  git bisect
“distributed development”
Git Magic: Versioning Files like a Boss
ssh-keygen
Git Magic: Versioning Files like a Boss
git push
git@github.com:cs50/project
        master
git remote add origin
git@github.com:cs50/project
git remote add origin
git@github.com:cs50/project
git push origin master
git clone
git@github.com:cs50/project
Git Magic: Versioning Files like a Boss
git pull origin master
Git Magic: Versioning Files like a Boss
git pull --rebase
git init
git add --all
git commit

  Alice         Bob
git remote add origin url
git push origin master

 Alice                      Bob
git remote add origin url
git push origin master

 Alice                      Bob
git clone url

Alice          Bob
git clone url

Alice          Bob
git add --all
        git commit

Alice          Bob
git push origin master

Alice                 Bob
git push origin master

Alice                 Bob
git pull origin master

Alice                    Bob
git pull origin master

Alice                    Bob
Git Magic: Versioning Files like a Boss
git branch -a
git checkout -b
   origin/test
scp ~/.ssh/id_rsa.pub
host:~/.ssh/authorized_keys
Git Magic: Versioning Files like a Boss
git init --bare
git remote add live
user@cloud.cs50.net:~/project
git remote add live
user@cloud.cs50.net:~/project
  git push live master
Hooks
•   applypatch-msg      •   post-applypatch

•   commit-msg          •   pre-commit

•   post-commit         •   pre-commit-msg

•   post-receive        •   pre-rebase

•   post-update         •   update
post-receive
#!/bin/sh
GIT_WORK_TREE=/home/tmacwill/public_html 
git checkout -f
chmod -R 644 /home/tmacwill/public_html/
*.html
chmod -R 600 /home/tmacwill/public_html/
*.php
Git Magic: Versioning Files like a Boss
Like a boss.
git clone
git push




git remote
  git pull
git clone
git push




git remote
  git pull
More Resources

• http://progit.org/book/
• http://book.git-scm.com/
• http://gitref.org/
• http://git-scm.com/documentation
git commit -a -m
     “thanks!”
Ad

More Related Content

What's hot (20)

Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
Daniel Kummer
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Pham Quy (Jack)
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
James Aylett
 
Git Basics - RubyFest 2009
Git Basics - RubyFest 2009Git Basics - RubyFest 2009
Git Basics - RubyFest 2009
Ariejan de Vroom
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
 
Git internals
Git internalsGit internals
Git internals
Haggai Philip Zagury
 
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e Merging
Rodrigo Branas
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Boise Web Technologies Group
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
Otto Kekäläinen
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
Jeremy Lindblom
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
Naim Latifi
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
Sergiu-Ioan Ungur
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
Git
GitGit
Git
Shinu Suresh
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
Daniel Kummer
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
James Aylett
 
Git Basics - RubyFest 2009
Git Basics - RubyFest 2009Git Basics - RubyFest 2009
Git Basics - RubyFest 2009
Ariejan de Vroom
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
 
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e Merging
Rodrigo Branas
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
Jeremy Lindblom
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
Naim Latifi
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 

Viewers also liked (8)

Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Community live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowCommunity live #1 - Gitflow Workflow
Community live #1 - Gitflow Workflow
Liora Milbaum
 
Puppet at GitHub - PuppetConf 2013
Puppet at GitHub - PuppetConf 2013Puppet at GitHub - PuppetConf 2013
Puppet at GitHub - PuppetConf 2013
Puppet
 
Git like a Pro (How to use it as it was meant to)
Git like a Pro (How to use it as it was meant to)Git like a Pro (How to use it as it was meant to)
Git like a Pro (How to use it as it was meant to)
Dennis Doomen
 
SemVer, the whole story
SemVer, the whole storySemVer, the whole story
SemVer, the whole story
JakeGinnivan
 
Pubmi gitflow
Pubmi gitflowPubmi gitflow
Pubmi gitflow
Simone Gentili
 
Semantic Versioning Lightning Talk
Semantic Versioning Lightning TalkSemantic Versioning Lightning Talk
Semantic Versioning Lightning Talk
Aaron Blythe
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Community live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowCommunity live #1 - Gitflow Workflow
Community live #1 - Gitflow Workflow
Liora Milbaum
 
Puppet at GitHub - PuppetConf 2013
Puppet at GitHub - PuppetConf 2013Puppet at GitHub - PuppetConf 2013
Puppet at GitHub - PuppetConf 2013
Puppet
 
Git like a Pro (How to use it as it was meant to)
Git like a Pro (How to use it as it was meant to)Git like a Pro (How to use it as it was meant to)
Git like a Pro (How to use it as it was meant to)
Dennis Doomen
 
SemVer, the whole story
SemVer, the whole storySemVer, the whole story
SemVer, the whole story
JakeGinnivan
 
Semantic Versioning Lightning Talk
Semantic Versioning Lightning TalkSemantic Versioning Lightning Talk
Semantic Versioning Lightning Talk
Aaron Blythe
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Ad

Similar to Git Magic: Versioning Files like a Boss (20)

Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Git Basics Philips
Git Basics PhilipsGit Basics Philips
Git Basics Philips
Ariejan de Vroom
 
Loading...git
Loading...gitLoading...git
Loading...git
Rafael García
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
Rodrigo Branas
 
SCM for Android Developers Using Git
SCM for Android Developers Using GitSCM for Android Developers Using Git
SCM for Android Developers Using Git
Tony Hillerson
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
Effective
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
EffectiveUI
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Working with Git
Working with GitWorking with Git
Working with Git
Pete Nicholls
 
Git 基础
Git 基础Git 基础
Git 基础
pan weizeng
 
simple Git
simple Git simple Git
simple Git
Caesar Chi
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
All Things Open
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
mpvanwinkle
 
Basic git
Basic gitBasic git
Basic git
Casper Chen
 
Git basics
Git basicsGit basics
Git basics
Amit Sawhney
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
Rodrigo Branas
 
SCM for Android Developers Using Git
SCM for Android Developers Using GitSCM for Android Developers Using Git
SCM for Android Developers Using Git
Tony Hillerson
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
Effective
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
EffectiveUI
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
All Things Open
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
mpvanwinkle
 
Ad

Recently uploaded (20)

Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 

Git Magic: Versioning Files like a Boss

Editor's Notes

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: \n
  • #9: \n
  • #10: mkdir repo\nvim index.php: &lt;?php echo &amp;#x2018;git rocks&amp;#x2019;; ?&gt;\nvim page.php: &lt;?php echo &amp;#x2018;tommy does, too&amp;#x2019;; ?&gt;\ngit init\n
  • #11: \n
  • #12: git status\n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: \n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: git add --all\ngit commit\n
  • #21: \n
  • #22: \n
  • #23: vim page2.php: &lt;?php echo &amp;#x2018;woo more commits&amp;#x2019;; ?&gt;\nvim index.php: &lt;?php echo &amp;#x2018;I made a change!&amp;#x2019;; ?&gt;\ngit add --all\ngit commit -m &amp;#x201C;another commit&amp;#x201D;\ngit log\n
  • #24: \n
  • #25: git show\ngit show PREVIOUS COMMIT\n
  • #26: \n
  • #27: \n
  • #28: \n
  • #29: \n
  • #30: \n
  • #31: git branch test\ngit branch\ngit checkout test\ngit branch\nvim crazy.php: &lt;?php echo &amp;#x2018;this is a crazy idea&amp;#x2019;; ?&gt;\ngit add --all\ngit commit -m &amp;#x201C;so crazy up in here&amp;#x201D;\nls\ngit log\ngit checkout master\nls\ngit log\n
  • #32: \n
  • #33: \n
  • #34: git branch\ngit checkout master\nvim index.php: &lt;?php echo &amp;#x2018;this page is boring&amp;#x2019;; ?&gt;\ngit add --all\ngit commit -m &amp;#x201C;third commit on master&amp;#x201D;\ngit merge test\ngit log\n
  • #35: git branch -D test\ngit branch\n
  • #36: \n
  • #37: \n
  • #38: git log --graph\ncd ../rebased\ngit checkout master\ngit rebase test\ngit log --graph\ncd ../repo\n
  • #39: \n
  • #40: \n
  • #41: \n
  • #42: \n
  • #43: \n
  • #44: \n
  • #45: \n
  • #46: ls\ngit log\nvim index.php: &lt;?php echo &amp;#x2018;good idea&amp;#x2019;; ?&gt;\ngit commit -a -m &amp;#x201C;sweet&amp;#x201D;\nvim index.php: &lt;?php echo &amp;#x2018;bad idea&amp;#x2019;; ?&gt;\ngit commit -a -m &amp;#x201C;oops&amp;#x201D;\ngit revert to commit &amp;#x201C;sweet&amp;#x201D;\nCONFLICT!\ngit status\nvim index.php\ngit commit -a -m &amp;#x201C;revert&amp;#x201D;\ngit log\n
  • #47: vim index.php: &lt;?php echo &amp;#x2018;only gonna add this&amp;#x2019;; ?&gt;\ngit add --all\ngit checkout -- index.php\nvim index.php\ngit checkout &lt;commit with &amp;#x201C;sweet&amp;#x201D;&gt; index.php\nvim index.php\n
  • #48: git reset --hard HEAD\n
  • #49: git checkout &lt;commit with &amp;#x201C;another commit&amp;#x201D;&gt;\ngit log\ngit reflog\ngit checkout master\n
  • #50: git bisect good &lt;first commit&gt;\ngit bisect bad HEAD\ngit bisect bad\ngit checkout master\n
  • #51: \n
  • #52: \n
  • #53: \n
  • #54: \n
  • #55: \n
  • #56: \n
  • #57: \n
  • #58: git remote add origin [email protected]:tmac721/seminar.git\ngit remote\ngit remote show origin\ngit push origin master\n
  • #59: cd ../\ngit clone [email protected]:tmac721/seminar.git\ncd test\nls\ngit log\n
  • #60: \n
  • #61: \n
  • #62: \n
  • #63: \n
  • #64: \n
  • #65: \n
  • #66: \n
  • #67: \n
  • #68: \n
  • #69: \n
  • #70: \n
  • #71: \n
  • #72: \n
  • #73: \n
  • #74: \n
  • #75: \n
  • #76: \n
  • #77: \n
  • #78: \n
  • #79: ssh cloud\nmkdir repo\ncd repo\ngit init --bare\ncd hooks\nvim post-receive: copy this\nchmod a+x post-receive\ngit remote add origin ssh://[email protected]/home/tmacwill/repo\ngit push origin master\n\n
  • #80: \n
  • #81: \n
  • #82: \n
  • #83: \n