際際滷

際際滷Share a Scribd company logo
Git & Github
workshop
Agenda
Git basics
- File status lifecycle
- Staging and committing
- Undoing things
Distributed Git & Github I
- Basic workflow (fork, commit, pull request)
Branching
- Creating and switching branches
- Merging
- Rebasing
Distributed Git & Github II
- Distributed workflow
- Synchronising with upstream
and resolving conflicts
Git basics
$ git init
Git basics - file status lifecycle
$ git status
untracked unmodified modified staged
add the file
edit the file
stage the file
remove the file
commit
Git basics - staging and committing
Stage file and track untracked files
$ git add <file name | wildcard>
Remove and stage file removal
$ git rm <file name | wildcard>
Commit staged changes
$ git commit -m <message>
Git basics - staging and commiting
$ cat .gitignore
tmp/ # ignore all files in tmp dir
logs/*.log # all files in logs dir with .log
*.tmp # all files with .tmp ext
Git basics - staging and commiting
Show unstaged changes
$ git diff
Show staged changes
$ git diff --cached
Git basics - staging and commiting
Show all commits with authors, dates and
descriptions
$ git log
Show all commits with complete diff
$ git log -p
Show all commits with additions/deletions
stats
$ git log --stat
Git basics - undoing things
Change last commit
$ git commit --amend
Unstage changes in given file
$ git reset HEAD <file name>
Revert unstaged changes in given file
$ git checkout -- <file name>
Git basics - distributed Git & Github I
blessed repository
Git basics - distributed Git & Github I
blessed repository
developer
public
developer
public
developer
public
fork
fork
fork
Git basics - distributed Git & Github I
blessed repository
developer
public
developer
public
developer
public
developer
private
developer
private
developer
private
clone clone clone
commit
Git basics - distributed Git & Github I
blessed repository
developer
public
developer
public
developer
public
developer
private
developer
private
developer
private
push
Git basics - distributed Git & Github I
blessed repository
developer
public
developer
public
developer
public
developer
private
developer
private
developer
private
pull request
Git basics - distributed Git & Github I
blessed repository
developer
public
developer
public
developer
public
developer
private
developer
private
developer
private
review pull request & merge
Git basics - distributed Git & Github I
$ git clone <url>
$ git push <remote> <branch>
Git basics - Creating and switching
branches
Create branch
$ git branch <name>
Activate branch
$ git checkout <name>
Remove branch
$ git branch -d <name>
Git basics - Creating and switching
branches
Merge changes from branch <branch> to
selected branch
$ git merge <branch>
c0
b1 c1
c2b2
c3
branch
commit
merge
Git basics - Creating and switching
branches
Rebase changes from branch <branch> to given
branch
$ git rebase <branch>
c0
b1 c1
c2b2
branch
commit
c0
b1 c1
c2
b2
branch
commit
c1
c2
rebase

More Related Content

What's hot (20)

Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
Get Familiar With Git
Get Familiar With Git Get Familiar With Git
Get Familiar With Git
Nigam Goyal
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
Sothearin Ren
Git in pills : git stash
Git in pills : git stashGit in pills : git stash
Git in pills : git stash
Federico Panini
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
Hoffman Lab
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Mizan Riqzia
Git slides
Git slidesGit slides
Git slides
Nguyen Van Hung
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
git internals
git internalsgit internals
git internals
Dennis Byrne
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
Abdul Basit
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
Joy Seng
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing
Git Cards - Powerpoint Format
Git Cards - Powerpoint FormatGit Cards - Powerpoint Format
Git Cards - Powerpoint Format
Adam Lowe
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Aleksey Asiutin
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
Atlanta Pm Git 101
Atlanta Pm Git 101Atlanta Pm Git 101
Atlanta Pm Git 101
Jason Noble
Git basic and workflow
Git basic and workflowGit basic and workflow
Git basic and workflow
buikhanhbk
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
Git basics
Git basicsGit basics
Git basics
Amit Sawhney
Get Familiar With Git
Get Familiar With Git Get Familiar With Git
Get Familiar With Git
Nigam Goyal
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
Sothearin Ren
Git in pills : git stash
Git in pills : git stashGit in pills : git stash
Git in pills : git stash
Federico Panini
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
Hoffman Lab
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Mizan Riqzia
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
Abdul Basit
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
Joy Seng
Git Cards - Powerpoint Format
Git Cards - Powerpoint FormatGit Cards - Powerpoint Format
Git Cards - Powerpoint Format
Adam Lowe
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
Atlanta Pm Git 101
Atlanta Pm Git 101Atlanta Pm Git 101
Atlanta Pm Git 101
Jason Noble
Git basic and workflow
Git basic and workflowGit basic and workflow
Git basic and workflow
buikhanhbk
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy

Similar to Brainly git basics workshop (20)

Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
srinathcox
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
John(Qiang) Zhang
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
vimukthirandika
Gittalk
GittalkGittalk
Gittalk
prtinsley
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
jaehyok Song
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
Git training cheat sheet
Git training cheat sheetGit training cheat sheet
Git training cheat sheet
Skander Hamza
git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucket
azwildcat
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
NiranjanKumarGanjiku1
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
Nguyen Van Hung
Git
GitGit
Git
AddWeb Solution Pvt. Ltd.
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
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
Prakash Dantuluri
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
Ashok Kumar
Loading...git
Loading...gitLoading...git
Loading...git
Rafael Garc鱈a
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
srinathcox
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
John(Qiang) Zhang
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
jaehyok Song
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
Git training cheat sheet
Git training cheat sheetGit training cheat sheet
Git training cheat sheet
Skander Hamza
git-and-bitbucket
git-and-bitbucketgit-and-bitbucket
git-and-bitbucket
azwildcat
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
NiranjanKumarGanjiku1
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
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
Ashok Kumar
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola

Recently uploaded (20)

Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]
haroonsaeed605
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP SolutionsWhy Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Absolute ERP
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
SE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.pptSE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.ppt
theworldimagine985
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
OutSystems User Group Utrecht February 2025.pdf
OutSystems User Group Utrecht February 2025.pdfOutSystems User Group Utrecht February 2025.pdf
OutSystems User Group Utrecht February 2025.pdf
mail496323
Minitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free DownloadMinitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free Download
v3r2eptd2q
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
Douwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-LatestDouwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-Latest
mubeen010khan
LLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protectedLLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protected
Ivo Andreev
Account Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odooAccount Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odoo
AxisTechnolabs
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Philip Schwarz
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
A Brief Introduction About Raman Bhaumik
A Brief Introduction About Raman BhaumikA Brief Introduction About Raman Bhaumik
A Brief Introduction About Raman Bhaumik
Raman Bhaumik
Elastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - VirtualElastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - Virtual
Gon巽alo Pereira
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]
haroonsaeed605
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP SolutionsWhy Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Absolute ERP
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
SE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.pptSE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.ppt
theworldimagine985
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
OutSystems User Group Utrecht February 2025.pdf
OutSystems User Group Utrecht February 2025.pdfOutSystems User Group Utrecht February 2025.pdf
OutSystems User Group Utrecht February 2025.pdf
mail496323
Minitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free DownloadMinitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free Download
v3r2eptd2q
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
Douwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-LatestDouwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-Latest
mubeen010khan
LLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protectedLLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protected
Ivo Andreev
Account Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odooAccount Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odoo
AxisTechnolabs
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Drawing Heighways Dragon - Recursive Function Rewrite - From Imperative Styl...
Philip Schwarz
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
A Brief Introduction About Raman Bhaumik
A Brief Introduction About Raman BhaumikA Brief Introduction About Raman Bhaumik
A Brief Introduction About Raman Bhaumik
Raman Bhaumik
Elastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - VirtualElastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - Virtual
Gon巽alo Pereira

Brainly git basics workshop

  • 2. Agenda Git basics - File status lifecycle - Staging and committing - Undoing things Distributed Git & Github I - Basic workflow (fork, commit, pull request) Branching - Creating and switching branches - Merging - Rebasing Distributed Git & Github II - Distributed workflow - Synchronising with upstream and resolving conflicts
  • 4. Git basics - file status lifecycle $ git status untracked unmodified modified staged add the file edit the file stage the file remove the file commit
  • 5. Git basics - staging and committing Stage file and track untracked files $ git add <file name | wildcard> Remove and stage file removal $ git rm <file name | wildcard> Commit staged changes $ git commit -m <message>
  • 6. Git basics - staging and commiting $ cat .gitignore tmp/ # ignore all files in tmp dir logs/*.log # all files in logs dir with .log *.tmp # all files with .tmp ext
  • 7. Git basics - staging and commiting Show unstaged changes $ git diff Show staged changes $ git diff --cached
  • 8. Git basics - staging and commiting Show all commits with authors, dates and descriptions $ git log Show all commits with complete diff $ git log -p Show all commits with additions/deletions stats $ git log --stat
  • 9. Git basics - undoing things Change last commit $ git commit --amend Unstage changes in given file $ git reset HEAD <file name> Revert unstaged changes in given file $ git checkout -- <file name>
  • 10. Git basics - distributed Git & Github I blessed repository
  • 11. Git basics - distributed Git & Github I blessed repository developer public developer public developer public fork fork fork
  • 12. Git basics - distributed Git & Github I blessed repository developer public developer public developer public developer private developer private developer private clone clone clone commit
  • 13. Git basics - distributed Git & Github I blessed repository developer public developer public developer public developer private developer private developer private push
  • 14. Git basics - distributed Git & Github I blessed repository developer public developer public developer public developer private developer private developer private pull request
  • 15. Git basics - distributed Git & Github I blessed repository developer public developer public developer public developer private developer private developer private review pull request & merge
  • 16. Git basics - distributed Git & Github I $ git clone <url> $ git push <remote> <branch>
  • 17. Git basics - Creating and switching branches Create branch $ git branch <name> Activate branch $ git checkout <name> Remove branch $ git branch -d <name>
  • 18. Git basics - Creating and switching branches Merge changes from branch <branch> to selected branch $ git merge <branch> c0 b1 c1 c2b2 c3 branch commit merge
  • 19. Git basics - Creating and switching branches Rebase changes from branch <branch> to given branch $ git rebase <branch> c0 b1 c1 c2b2 branch commit c0 b1 c1 c2 b2 branch commit c1 c2 rebase