SlideShare a Scribd company logo
A Distributed Version Control System
goals
• svn vs git

• typical git workflow

• logs

• branching, merging & tagging

• undoing

• next steps
svn vs git
svn
git
local repository
fast
shareable
safer
git command line
git --help
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
tag Create, list, delete or verify a tag object signed with GPG
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
git clone
git clone https://github.com/h5bp/html5-boilerplate.git
git clone git@github.com:h5bp/html5-boilerplate.git
.git/
.git/config
.git/refs
.git/HEAD
the git workflow
git status
git diff
git add
git commit -m ‘Message’
this is very different from svn’s commit
git push origin master
git pull/fetch
walkthrough
new repository
git init
git remote add origin <repo>
git remote -v
git push origin master
git push <name> <branch>
walkthrough
logs
git log
commit 35caa01bfa4cbff15d06382021e2028bdf0a77ad
Author: Aryeh Weinreb <aryehweinreb@gmail.com>
Date: Wed May 10 01:59:20 2017 +0300
Add options to host.autostart.add (#719)
commit 2030458d4e8ea0bbf0363ea109d0f3004686e802
Author: Doug MacEachern <dougm@vmware.com>
Date: Thu May 4 15:31:55 2017 -0700
Add VC options command (#717)
Refactor host.options commands so they support vCenter
commit 0ccad10c7a0af6ec3920e164ebca957ac4535729
Author: aniketGslab <aniket.shinde@gslab.com>
Date: Thu May 4 20:41:00 2017 +0530
Exported FindSnapshot() Method (#715)
commit 35caa01bfa4cbff15d06382021e2028bdf0a77ad
Author: Aryeh Weinreb <aryehweinreb@gmail.com>
Date: Wed May 10 01:59:20 2017 +0300
Add options to host.autostart.add (#719)
commit 2030458d4e8ea0bbf0363ea109d0f3004686e802
Author: Doug MacEachern <dougm@vmware.com>
Date: Thu May 4 15:31:55 2017 -0700
Add VC options command (#717)
Refactor host.options commands so they support vCenter
commit 0ccad10c7a0af6ec3920e164ebca957ac4535729
Author: aniketGslab <aniket.shinde@gslab.com>
Date: Thu May 4 20:41:00 2017 +0530
Exported FindSnapshot() Method (#715)
commit 35caa01bfa4cbff15d06382021e2028bdf0a77ad
Author: Aryeh Weinreb <aryehweinreb@gmail.com>
Date: Wed May 10 01:59:20 2017 +0300
Add options to host.autostart.add (#719)
commit 2030458d4e8ea0bbf0363ea109d0f3004686e802
Author: Doug MacEachern <dougm@vmware.com>
Date: Thu May 4 15:31:55 2017 -0700
Add VC options command (#717)
Refactor host.options commands so they support vCenter
commit 0ccad10c7a0af6ec3920e164ebca957ac4535729
Author: aniketGslab <aniket.shinde@gslab.com>
Date: Thu May 4 20:41:00 2017 +0530
Exported FindSnapshot() Method (#715)
git log -1
git log -2
git log -10
git log --oneline
35caa01 Add options to host.autostart.add (#719)
2030458 Add VC options command (#717)
0ccad10 Exported FindSnapshot() Method (#715)
git log --oneline --graph
* 35caa01 Add options to host.autostart.add (#719)
* 2030458 Add VC options command (#717)
* 0ccad10 Exported FindSnapshot() Method (#715)
* b8b228c Merge pull request #714 from BaluDontu/
|
| * 34202ac Additional wrapper functions for SPBM
|/
* 35ddbd4 Merge pull request #713 from dougm/methods
|
| * c7f718b Add AuthorizationManager {Enable,Disable}Methods
|/
* 5072cda Merge pull request #711 from dougm/pbm
git log --stat
git log --author="Who"
git log --grep="what"
git log --no-merges
git log --merges
walkthrough
ignoring things
.gitignore
sample/
.cache
venv
docs/build/
.idea
*.py?
__pycache__/
.coverage
chalice.egg-info/
branching
git branch
git branch <name>
git checkout <name>
git checkout -b <name>
git merge <target-branch>
git rebase <target-branch>
tagging
git tag <tagname>
git tag -a v1.1 -m ‘Description’
mistakes happen
git reset HEAD <file>
git checkout -- <file>
git reset --hard <SHA>
git reset --hard
CAUTION - this reset is global!
walkthrough
next steps…
https://try.github.io/
• Stashing

• Submodules

• Subtree

• Multiple Remotes
useful topics
• Interactive Staging

• Amends

• Git Hooks

• Sharing with git daemon
bitbucket
pull requests
ui client
git UI client
questions?
wee.keat.chin@mlcinsurance.com.au

More Related Content

What's hot

18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
LearningTech
 

What's hot (20)

Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Git
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
 
Introduction to Git Version Control System
Introduction to Git Version Control SystemIntroduction to Git Version Control System
Introduction to Git Version Control System
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
Gittalk
GittalkGittalk
Gittalk
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
 
Git github
Git githubGit github
Git github
 
GIT - GOOD PRACTICES
GIT - GOOD PRACTICESGIT - GOOD PRACTICES
GIT - GOOD PRACTICES
 
Git locally git rm/revert/reset
Git locally git rm/revert/resetGit locally git rm/revert/reset
Git locally git rm/revert/reset
 
Git basic commands
Git basic commandsGit basic commands
Git basic commands
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Querying the History of Software Projects using QwalKeko
Querying the History of Software Projects using QwalKekoQuerying the History of Software Projects using QwalKeko
Querying the History of Software Projects using QwalKeko
 
Tài liệu sử dụng GitHub
Tài liệu sử dụng GitHubTài liệu sử dụng GitHub
Tài liệu sử dụng GitHub
 
HackMTY - GitHub Workshop
HackMTY - GitHub WorkshopHackMTY - GitHub Workshop
HackMTY - GitHub Workshop
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git locally - part 1
Git locally - part 1Git locally - part 1
Git locally - part 1
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
 

Similar to Git foundation

Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
Terry Wang
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 

Similar to Git foundation (20)

Git cheat sheet with diagram-5.pdf
Git cheat sheet with diagram-5.pdfGit cheat sheet with diagram-5.pdf
Git cheat sheet with diagram-5.pdf
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
Git slides
Git slidesGit slides
Git slides
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git
GitGit
Git
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 

More from Wee Keat Chin (8)

Deployment Automation - My journey at Peazie
Deployment Automation - My journey at PeazieDeployment Automation - My journey at Peazie
Deployment Automation - My journey at Peazie
 
Automating with CloudFormation
Automating with CloudFormationAutomating with CloudFormation
Automating with CloudFormation
 
AMQP for phpMelb
AMQP for phpMelbAMQP for phpMelb
AMQP for phpMelb
 
Getting Started with Arduino
Getting Started with ArduinoGetting Started with Arduino
Getting Started with Arduino
 
Continuous delivery
Continuous deliveryContinuous delivery
Continuous delivery
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQP
 
Getting agile
Getting agileGetting agile
Getting agile
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

Git foundation