SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
“Ways of Working” - Royal Mail Data Science Team Seminar
https://git-scm/blog
Dr. Jason Byrne
Jan. 2018
1
Ways of Working | Version Control & Git
Royal Mail | GBI | Data Science
Team Seminar
Dr. Jason Byrne
Jan. 2018
2
Collaboration
Due	Diligence
Track	changes
Backup
Store	versions
Coordination
Agile
Version Control: Motivation
3
Version Control: Development Branches
4
Distributed Version Control System
5
https://git-scm.com
5
git-scm.com/blog6
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference (repository).
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog7
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference (repository).
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git add
git commit
git commit -a
git-scm.com/blog8
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git init
git-scm.com/blog9
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog10
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog11
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog12
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog13
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog14
HEAD

is the snapshot of your last commit, or the pointer to the current branch reference.
Index

is the snapshot of your next commit (staging area).
Working Directory

is your scratch space used to easily modify file content.
git-scm.com/blog15
git reset

moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to).
--soft 

with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit.
git commit --amend

this is an option that simplifies changing the last commit instead of needing to use reset.
git-scm.com/blog16
git reset

moves what HEAD points to and updates the Index with the contents of the tree HEAD now points to.
--mixed 

with this flag, reset stops after moving HEAD and updating the index. This is also the default.
git add & git commit 

this reset undid your last commit and unstaged everything. Any edits need to be added & committed again.
git-scm.com/blog17
git reset

moves what HEAD points to and updates the Index with the contents of the tree HEAD now points to.
--hard 

with this flag, reset moves HEAD, updates the index, and makes the Working Directory look like the Index.
git reflog 

ordered list of the commits that HEAD has pointed to (as opposed to log which traverses HEAD’s ancestry).
git-scm.com/blog18
git reset HEAD~# [filename]

updates part of the Index to match the version from the specified commit (where the tree HEAD now points to).
--soft|mixed|hard 

no effect as the staged snapshot (Index) is always updated and Working Directory is never updated.
git add [filename] 

is essentially the opposite command, as the reset basically unstages the file.
git-scm.com/blog19
git reset HEAD~# [filename]

updates part of the Index to match the version from the specified commit (where the tree HEAD now points to).
--soft|mixed|hard 

no effect as the staged snapshot (Index) is always updated and Working Directory is never updated.
git add [filename] 

is essentially the opposite command, as the reset basically unstages the file.
git-scm.com/blog20
git reset HEAD~# [filename]

updates part of the Index to match the version from the specified commit.
--soft|mixed|hard 

no effect as the staged snapshot (Index) is always updated and Working Directory is never updated.
git add [filename]

is essentially the opposite command, as the reset basically unstages the file.
git-scm.com/blog21
git reset example to demonstrate squashing unimportant commits to clean up history.

moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to).
--soft 

with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit.
git commit 

commits the latest changes staged in Index.
38eb946
git-scm.com/blog22
git reset example to demonstrate squashing unimportant commits to clean up history.

moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to).
--soft 

with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit.
git commit 

commits the latest changes staged in Index.
--soft
git-scm.com/blog23
git reset example to demonstrate squashing unimportant commits to clean up history.

moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to).
--soft 

with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit.
git commit 

commits the latest changes staged in Index.
68aef35
git-scm.com/blog24
git reset --hard [branch]

moves the branch HEAD points to, updates the Index, and makes the Working Directory look like the Index.
git checkout [branch]

moves HEAD to point at the branch and updates the Index and Working Directory accordingly.
git branch 

shows the current branch HEAD points at.
25
26
git init [repo name]

initialise a git repository.
git status

show status of git repository.
git log [filename]

shows current HEAD and its ancestry / commit log accessible from the git refs.
git reflog [show HEAD | --all | otherbranch]

reference logs track when git refs were updated in the local repository. (Doesn’t traverse HEAD’s
ancestry.)
git add [filename]

add file to staging area.
git commit -m “[message]”

commit file with reference message.
git show [ID | HEAD~#]

show the history of a specific commit identified by 40-character hexadecimal string.
git annotate [filename]

show the details of the last change to a file.
git diff -r HEAD [filename] 

show the difference between a file and its latest commit.
git diff ID1..ID2 [ID is SHA/hash | HEAD~#] or git diff branch1..branch2

show the difference between two commits or branches.
git clean

clean up untracked files or directories.
git config --[system | global | local]

configuration settings for every user / every project / specific project, & set user credentials.
summary
26
27
git checkout -- [filename]

discard changes to file before staging (i.e. before adding them to staging area for commit).
git checkout ID [filename]

restore the previous version at the specified hash ID of a file or directory.
git checkout [branch name]

change to branch (i.e. move where HEAD is pointing and update working trees accordingly).
git reset HEAD [filename]

reset the file or directory to the state it was last staged.
git merge [source] [destination]

merge the source branch with the destination branch - resolving conflicts as necessary.
git clone URL [repo name]

clone a git repository from the URL which can point to a web address (http://) or a file location (file://).
git remote -v

list the names of the repository’s remote configurations & URLs.
git pull remote branch

pull changes from the remote repository and merge them into the current branch of your local
repository.
git push remote branch

pushes the contents of your branch into a branch with the same name in the associated remote
repository.
git fetch remote branch

pull changes from the remote repository to your local repository.
git stash

stash changes in the remote repository rather than pushing them, useful to switch branches during
development.
summary
27

Contenu connexe

Tendances

Learning git
Learning gitLearning git
Learning gitSid Anand
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Noa Harel
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git BasicsSreedath N S
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewRueful Robin
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitLuigi De Russis
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 

Tendances (20)

Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git training v10
Git training v10Git training v10
Git training v10
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Learning git
Learning gitLearning git
Learning git
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git commands
Git commandsGit commands
Git commands
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 

Similaire à Version Control & Git

Similaire à Version Control & Git (20)

Git basic
Git basicGit basic
Git basic
 
Git SCM
Git SCMGit SCM
Git SCM
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
 
Git like a pro EDD18 - Full edition
Git like a pro EDD18 - Full editionGit like a pro EDD18 - Full edition
Git like a pro EDD18 - Full edition
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Git training
Git trainingGit training
Git training
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git slides
Git slidesGit slides
Git slides
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
 
Git commands
Git commandsGit commands
Git commands
 
Git undo
Git undoGit undo
Git undo
 
Exprimiendo GIT
Exprimiendo GITExprimiendo GIT
Exprimiendo GIT
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git introduction
Git introductionGit introduction
Git introduction
 

Dernier

Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 

Dernier (20)

Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 

Version Control & Git

  • 1. “Ways of Working” - Royal Mail Data Science Team Seminar https://git-scm/blog Dr. Jason Byrne Jan. 2018 1 Ways of Working | Version Control & Git Royal Mail | GBI | Data Science Team Seminar Dr. Jason Byrne Jan. 2018
  • 6. git-scm.com/blog6 HEAD is the snapshot of your last commit, or the pointer to the current branch reference (repository). Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 7. git-scm.com/blog7 HEAD is the snapshot of your last commit, or the pointer to the current branch reference (repository). Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content. git add git commit git commit -a
  • 8. git-scm.com/blog8 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content. git init
  • 9. git-scm.com/blog9 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 10. git-scm.com/blog10 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 11. git-scm.com/blog11 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 12. git-scm.com/blog12 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 13. git-scm.com/blog13 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 14. git-scm.com/blog14 HEAD is the snapshot of your last commit, or the pointer to the current branch reference. Index is the snapshot of your next commit (staging area). Working Directory is your scratch space used to easily modify file content.
  • 15. git-scm.com/blog15 git reset moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to). --soft with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit. git commit --amend this is an option that simplifies changing the last commit instead of needing to use reset.
  • 16. git-scm.com/blog16 git reset moves what HEAD points to and updates the Index with the contents of the tree HEAD now points to. --mixed with this flag, reset stops after moving HEAD and updating the index. This is also the default. git add & git commit this reset undid your last commit and unstaged everything. Any edits need to be added & committed again.
  • 17. git-scm.com/blog17 git reset moves what HEAD points to and updates the Index with the contents of the tree HEAD now points to. --hard with this flag, reset moves HEAD, updates the index, and makes the Working Directory look like the Index. git reflog ordered list of the commits that HEAD has pointed to (as opposed to log which traverses HEAD’s ancestry).
  • 18. git-scm.com/blog18 git reset HEAD~# [filename] updates part of the Index to match the version from the specified commit (where the tree HEAD now points to). --soft|mixed|hard no effect as the staged snapshot (Index) is always updated and Working Directory is never updated. git add [filename] is essentially the opposite command, as the reset basically unstages the file.
  • 19. git-scm.com/blog19 git reset HEAD~# [filename] updates part of the Index to match the version from the specified commit (where the tree HEAD now points to). --soft|mixed|hard no effect as the staged snapshot (Index) is always updated and Working Directory is never updated. git add [filename] is essentially the opposite command, as the reset basically unstages the file.
  • 20. git-scm.com/blog20 git reset HEAD~# [filename] updates part of the Index to match the version from the specified commit. --soft|mixed|hard no effect as the staged snapshot (Index) is always updated and Working Directory is never updated. git add [filename] is essentially the opposite command, as the reset basically unstages the file.
  • 21. git-scm.com/blog21 git reset example to demonstrate squashing unimportant commits to clean up history. moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to). --soft with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit. git commit commits the latest changes staged in Index. 38eb946
  • 22. git-scm.com/blog22 git reset example to demonstrate squashing unimportant commits to clean up history. moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to). --soft with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit. git commit commits the latest changes staged in Index. --soft
  • 23. git-scm.com/blog23 git reset example to demonstrate squashing unimportant commits to clean up history. moves what HEAD points to (and updates the Index with the contents of the tree HEAD now points to). --soft with this flag, moving HEAD is the only thing reset does, essentially undoing your last commit. git commit commits the latest changes staged in Index. 68aef35
  • 24. git-scm.com/blog24 git reset --hard [branch] moves the branch HEAD points to, updates the Index, and makes the Working Directory look like the Index. git checkout [branch] moves HEAD to point at the branch and updates the Index and Working Directory accordingly. git branch shows the current branch HEAD points at.
  • 25. 25
  • 26. 26 git init [repo name] initialise a git repository. git status show status of git repository. git log [filename] shows current HEAD and its ancestry / commit log accessible from the git refs. git reflog [show HEAD | --all | otherbranch] reference logs track when git refs were updated in the local repository. (Doesn’t traverse HEAD’s ancestry.) git add [filename] add file to staging area. git commit -m “[message]” commit file with reference message. git show [ID | HEAD~#] show the history of a specific commit identified by 40-character hexadecimal string. git annotate [filename] show the details of the last change to a file. git diff -r HEAD [filename] show the difference between a file and its latest commit. git diff ID1..ID2 [ID is SHA/hash | HEAD~#] or git diff branch1..branch2 show the difference between two commits or branches. git clean clean up untracked files or directories. git config --[system | global | local] configuration settings for every user / every project / specific project, & set user credentials. summary 26
  • 27. 27 git checkout -- [filename] discard changes to file before staging (i.e. before adding them to staging area for commit). git checkout ID [filename] restore the previous version at the specified hash ID of a file or directory. git checkout [branch name] change to branch (i.e. move where HEAD is pointing and update working trees accordingly). git reset HEAD [filename] reset the file or directory to the state it was last staged. git merge [source] [destination] merge the source branch with the destination branch - resolving conflicts as necessary. git clone URL [repo name] clone a git repository from the URL which can point to a web address (http://) or a file location (file://). git remote -v list the names of the repository’s remote configurations & URLs. git pull remote branch pull changes from the remote repository and merge them into the current branch of your local repository. git push remote branch pushes the contents of your branch into a branch with the same name in the associated remote repository. git fetch remote branch pull changes from the remote repository to your local repository. git stash stash changes in the remote repository rather than pushing them, useful to switch branches during development. summary 27