SlideShare a Scribd company logo
Git Operation 101
Kyohei Moriyama
Git init
Create Git repos locally
Git clone
Clone repository from remote
Remote repository
Local repository
Git add
Local repository
Add files that will be managed by local repos
$git add <localfiles>
Local repository
Add files that will be managed by local repos
$git add –A # add all files on local directory
.gitignore # special file for git
If you don’t want to add some specific files to git repository,
you can use .gitignore special files on your git repos.
<.gitignore>
.env
.xxx
.oooo
.bashrc … etc…
You can refer to the following url to find your .gitignore that you may like for your programming language…
https://github.com/github/gitignore
Git commit
Local repository
commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master,
origin/master, origin/HEAD)
Author: dasfsad <asdfasdf@microsoft.com>
Date: Tue Jul 21 09:45:10 2020 +0800
commit message #3
commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348
Author: asdfasdf <hlkasjdf@gmail.com>
Date: Mon Jul 20 17:42:23 2020 +0800
commit message #2
commit 042101asdfasdfasdfdf7f086a42c96e0d2a
Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com>
Date: Mon Jul 20 17:02:32 2020 +0800
commit message #1
Commit change file to your local repos,
commit required commit message like below.
$git commit –m “commit message is here”
commit #1 commit #2 commit #3
Git push
remote repository
commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master,
origin/master, origin/HEAD)
Author: dasfsad <asdfasdf@microsoft.com>
Date: Tue Jul 21 09:45:10 2020 +0800
commit message #3
commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348
Author: asdfasdf <hlkasjdf@gmail.com>
Date: Mon Jul 20 17:42:23 2020 +0800
commit message #2
commit 042101asdfasdfasdfdf7f086a42c96e0d2a
Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com>
Date: Mon Jul 20 17:02:32 2020 +0800
commit message #1
Local repository
commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master,
origin/master, origin/HEAD)
Author: dasfsad <asdfasdf@microsoft.com>
Date: Tue Jul 21 09:45:10 2020 +0800
commit message #3
commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348
Author: asdfasdf <hlkasjdf@gmail.com>
Date: Mon Jul 20 17:42:23 2020 +0800
commit message #2
commit 042101asdfasdfasdfdf7f086a42c96e0d2a
Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com>
Date: Mon Jul 20 17:02:32 2020 +0800
commit message #1
Git squash
Local repository
commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master,
origin/master, origin/HEAD)
Author: dasfsad <asdfasdf@microsoft.com>
Date: Tue Jul 21 09:45:10 2020 +0800
commit message #3
commit 042101asdfasdfasdfdf7f086a42c96e0d2a
Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com>
Date: Mon Jul 20 17:02:32 2020 +0800
commit message #1
commit #1 commit #2 commit #3
Git branch
Local repository : ☆master branch
commit #1
Local repository : patch-1 branch
commit #1
Git checkout
Local repository : master branch
commit #1
Local repository : ☆patch-1 branch
commit #1
Check out has meaning changing branch to others on local repos.
Git branch -> checkout -> commit
Local repository : master branch
commit #1
Local repository : patch-1 branch
commit #1 commit #2
Git branch -> checkout -> commit -> merge
Local repository : master branch
commit #1
Local repository : patch-1 branch
commit #1 commit #2
commit #2
Git branch -> checkout -> commit -> push to remote patch branch
remote repository : patch branch
commit #1
Local repository : patch-1 branch
commit #1 commit #2
commit #2
Local repository : master branch
commit #1
Git branch -> checkout -> commit -> push to remote patch branch
-> pull request
remote repository : patch branch
commit #1
Local repository : patch-1 branch
commit #1 commit #2
commit #2
Local repository : master branch
commit #1
remote repository : master branch
commit #1
Pull request
Git branch -> checkout -> commit -> push to remote patch branch
-> pull request -> pull accept/merge
Remote repository : patch branch
commit #1
Local repository : patch-1 branch
commit #1 commit #2
commit #2
Local repository : master branch
commit #1
Remote repository : master branch
commit #1
Pull accept / marge
commit #2

More Related Content

PDF
How to become a Git power user
ODP
DrupalCafe5 VCS
PDF
Github integration-kostyasha
PDF
Hello git
ODP
Introduction to Git (Greg Lonnon)
PDF
Git in pills : git stash
PDF
Git Real
How to become a Git power user
DrupalCafe5 VCS
Github integration-kostyasha
Hello git
Introduction to Git (Greg Lonnon)
Git in pills : git stash
Git Real

What's hot (20)

PPTX
Intro to Git DevOps Tally Presentation 101615
KEY
Git Acquainted
PDF
Gitosis on Mac OS X Server
PPTX
PDF
git. WTF is it doing anyway?
PPTX
email delivery
PDF
Git 101 Workshop
PDF
Git walkthrough
PPTX
Get going with_git_ppt
KEY
Git Magic: Versioning Files like a Boss
PDF
Git - Get Ready To Use It
PDF
Magie di git
PDF
PDF
GIT - GOOD PRACTICES
PDF
GitGot: The Swiss Army Chainsaw of Git Repo Management
PDF
Git essentials
PDF
A Simple Introduction to Git
PDF
Introduction to git
KEY
Git Distributed Version Control System
Intro to Git DevOps Tally Presentation 101615
Git Acquainted
Gitosis on Mac OS X Server
git. WTF is it doing anyway?
email delivery
Git 101 Workshop
Git walkthrough
Get going with_git_ppt
Git Magic: Versioning Files like a Boss
Git - Get Ready To Use It
Magie di git
GIT - GOOD PRACTICES
GitGot: The Swiss Army Chainsaw of Git Repo Management
Git essentials
A Simple Introduction to Git
Introduction to git
Git Distributed Version Control System
Ad

Similar to Git operation 101 (20)

PDF
Did you git yet?
PDF
Essential git fu for tech writers
PDF
Getting some Git
PDF
Git-ing out of your git messes - Fluent Conf 2017
PDF
Git and github 101
PDF
Version Control with Git for Beginners
PDF
Git Basics (Professionals)
PPTX
Workshop[3ed Apr]-[Git]
DOCX
Git setuplinux
DOCX
GitSetupLinux
PDF
Learn Git Fundamentals
PDF
git-commands-cheat-sheet-infopediya-com.pdf
PPTX
Git learning
PPT
Git 101 - Crash Course in Version Control using Git
PPTX
Git session Dropsolid.com
PPTX
Techoalien git
PPTX
Techoalien git
PPTX
Techoalien git
PDF
Git For The Android Developer
PPT
Git installation and configuration
Did you git yet?
Essential git fu for tech writers
Getting some Git
Git-ing out of your git messes - Fluent Conf 2017
Git and github 101
Version Control with Git for Beginners
Git Basics (Professionals)
Workshop[3ed Apr]-[Git]
Git setuplinux
GitSetupLinux
Learn Git Fundamentals
git-commands-cheat-sheet-infopediya-com.pdf
Git learning
Git 101 - Crash Course in Version Control using Git
Git session Dropsolid.com
Techoalien git
Techoalien git
Techoalien git
Git For The Android Developer
Git installation and configuration
Ad

More from Kyohei Moriyama (11)

PDF
Goのはじめかた
PPTX
Self-Introduction with DevOps
PDF
Jenkins x azure
PDF
TerraformとAzureを組み合わせて使うときの勘所
PPTX
Open@Microsoftを眺めてみる
PPTX
2017 10-06 マイクロビットプログラミング
PPTX
Amazonで買えるarduino互換ボードまとめ
PPTX
Sdn japan2016 hpe_switch_story_v2
PPTX
Open stack and sdn hands-on and demo
PPTX
Sightseeing
PPTX
Dailymotion problem
Goのはじめかた
Self-Introduction with DevOps
Jenkins x azure
TerraformとAzureを組み合わせて使うときの勘所
Open@Microsoftを眺めてみる
2017 10-06 マイクロビットプログラミング
Amazonで買えるarduino互換ボードまとめ
Sdn japan2016 hpe_switch_story_v2
Open stack and sdn hands-on and demo
Sightseeing
Dailymotion problem

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
sap open course for s4hana steps from ECC to s4
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Git operation 101

  • 2. Git init Create Git repos locally
  • 3. Git clone Clone repository from remote Remote repository Local repository
  • 4. Git add Local repository Add files that will be managed by local repos $git add <localfiles> Local repository Add files that will be managed by local repos $git add –A # add all files on local directory
  • 5. .gitignore # special file for git If you don’t want to add some specific files to git repository, you can use .gitignore special files on your git repos. <.gitignore> .env .xxx .oooo .bashrc … etc… You can refer to the following url to find your .gitignore that you may like for your programming language… https://github.com/github/gitignore
  • 6. Git commit Local repository commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master, origin/master, origin/HEAD) Author: dasfsad <asdfasdf@microsoft.com> Date: Tue Jul 21 09:45:10 2020 +0800 commit message #3 commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348 Author: asdfasdf <hlkasjdf@gmail.com> Date: Mon Jul 20 17:42:23 2020 +0800 commit message #2 commit 042101asdfasdfasdfdf7f086a42c96e0d2a Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com> Date: Mon Jul 20 17:02:32 2020 +0800 commit message #1 Commit change file to your local repos, commit required commit message like below. $git commit –m “commit message is here” commit #1 commit #2 commit #3
  • 7. Git push remote repository commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master, origin/master, origin/HEAD) Author: dasfsad <asdfasdf@microsoft.com> Date: Tue Jul 21 09:45:10 2020 +0800 commit message #3 commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348 Author: asdfasdf <hlkasjdf@gmail.com> Date: Mon Jul 20 17:42:23 2020 +0800 commit message #2 commit 042101asdfasdfasdfdf7f086a42c96e0d2a Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com> Date: Mon Jul 20 17:02:32 2020 +0800 commit message #1 Local repository commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master, origin/master, origin/HEAD) Author: dasfsad <asdfasdf@microsoft.com> Date: Tue Jul 21 09:45:10 2020 +0800 commit message #3 commit f8f3a8asdfasdfad85b3cc4b3c38af75006aaf348 Author: asdfasdf <hlkasjdf@gmail.com> Date: Mon Jul 20 17:42:23 2020 +0800 commit message #2 commit 042101asdfasdfasdfdf7f086a42c96e0d2a Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com> Date: Mon Jul 20 17:02:32 2020 +0800 commit message #1
  • 8. Git squash Local repository commit 8aeaasdfasdfasdfasdf614739a73a570730edefa8 (HEAD -> master, origin/master, origin/HEAD) Author: dasfsad <asdfasdf@microsoft.com> Date: Tue Jul 21 09:45:10 2020 +0800 commit message #3 commit 042101asdfasdfasdfdf7f086a42c96e0d2a Author: asdfaker sadfajlke <asdfasdfasdf@gmail.com> Date: Mon Jul 20 17:02:32 2020 +0800 commit message #1 commit #1 commit #2 commit #3
  • 9. Git branch Local repository : ☆master branch commit #1 Local repository : patch-1 branch commit #1
  • 10. Git checkout Local repository : master branch commit #1 Local repository : ☆patch-1 branch commit #1 Check out has meaning changing branch to others on local repos.
  • 11. Git branch -> checkout -> commit Local repository : master branch commit #1 Local repository : patch-1 branch commit #1 commit #2
  • 12. Git branch -> checkout -> commit -> merge Local repository : master branch commit #1 Local repository : patch-1 branch commit #1 commit #2 commit #2
  • 13. Git branch -> checkout -> commit -> push to remote patch branch remote repository : patch branch commit #1 Local repository : patch-1 branch commit #1 commit #2 commit #2 Local repository : master branch commit #1
  • 14. Git branch -> checkout -> commit -> push to remote patch branch -> pull request remote repository : patch branch commit #1 Local repository : patch-1 branch commit #1 commit #2 commit #2 Local repository : master branch commit #1 remote repository : master branch commit #1 Pull request
  • 15. Git branch -> checkout -> commit -> push to remote patch branch -> pull request -> pull accept/merge Remote repository : patch branch commit #1 Local repository : patch-1 branch commit #1 commit #2 commit #2 Local repository : master branch commit #1 Remote repository : master branch commit #1 Pull accept / marge commit #2