SlideShare a Scribd company logo
Git Cheat Sheet
Git is a distributed version-control system for tracking changes in source code during
software development.
by lam
󰅂Con gure tooling
Con gure user information
for all local repositories
Sets the name you want
attached to your commit
transactions
git config --global use
r.name "[name]"
Sets the email you want
attached to your commit
transactions
git config --global use
r.email "[email addres
s]"
Enables helpful colorization of
command line output
git config --global col
or.ui auto
󰅂Create repositories
When starting out with a new
repository, you only need to
do it once; either locally, then
push to GitHub, or by cloning
an existing repository.
Turn an existing directory into
a git repository
git init
Clone (download) a repository
that already exists on GitHub,
including all of the les,
branches, and commits
git clone [url]
󰅂The .gitgnore le
Sometimes it may be a good
idea to exclude les from
being tracked with Git. This is
typically done in a special le
named .gitignore . You can
nd helpful templates for
.gitignore les at
github.com/github/gitignore.
󰅂Branches
Branches are an important
part of working with Git. Any
commits you make will be
made on the branch you're
currently “checked out” to.
Use git status to see which
branch that is.
Creates a new branch
git branch [branch-nam
e]
Switches to the speci ed
branch and updates the
working directory
git checkout [branch-na
me]
Combines the speci ed
branch’s history into the
current branch. This is usually
done in pull requests but is an
important Git operation.
git merge [branch]
Deletes the speci ed branch
git branch -d [branch-n
󰅂
Synchronize
changes
Synchronize your local
repository with the remote
repository on GitHub.com
Downloads all history from
the remote tracking branches
git fetch
Combines remote tracking
branch into current local
branch
git merge
Uploads all local branch
commits to GitHub
git push
Updates your current local
working branch with all new
󰅂Make changes
Browse and inspect the
evolution of project les
Lists version history for the
current branch
git log
Lists version history for a le,
including renames
git log --follow [file]
Shows content di erences
between two branches
git diff [first-branc
h]...[second-branch]
󰏪
󰅢
ame]
commits from the
corresponding remote branch
on GitHub. git pull is a
combination of git fetch and
git merge 
git pull
Outputs metadata and
content changes of the
speci ed commit
git show [commit]
Snapshots the le in
preparation for versioning
git add [file]
Records le snapshots
permanently in version history
git commit -m "[descrip
tive message]"
󰅂Redo commits
Erase mistakes and craft
replacement history
Undoes all commits after
[commit], preserving changes
locally
git reset [commit]
Discards all history and
changes back to the speci ed
commit
git reset --hard [commi
t]
󰅂Glossary
an open source, distributed
version-control system 
git
a platform for hosting and
collaborating on Git
repositories 
GitHub
a Git object, a snapshot of
your entire repository
compressed into a SHA 
commit
a lightweight movable pointer
to a commit 
branch
a local version of a repository,
including all commits and
branches 
clone
a common repository on
GitHub that all team member
use to exchange their changes 
remote
a copy of a repository on
GitHub owned by a di erent
user 
fork
a place to compare and discuss
the di erences introduced on
a branch with reviews,
comments, integrated tests,
󰏪
󰅢
CheatSheetMaker.com SimpleCheatSheet.com
and more 
pull request
representing your current
working directory, the HEAD
pointer can be moved to
di erent branches, tags, or
commits when using git
checkout
HEAD
󰏪
󰅢

More Related Content

What's hot

Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
Terry Wang
 
test
testtest
test
zwned
 
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
viet nghiem
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
Himanshu Agrawal
 
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
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
Nikhil Vishnu P.V
 
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
Rasan Samarasinghe
 
Git cheat-sheet-education
Git cheat-sheet-educationGit cheat-sheet-education
Git cheat-sheet-education
Avitesh Kesharwani
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
Gaurav Kumar Garg
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
 
Git for developers
Git for developersGit for developers
Git for developers
Hacen Dadda
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
gdgjss
 
From svn to git
From svn to gitFrom svn to git
From svn to git
Nehal Shah
 
Git undo
Git undoGit undo
Git undo
Avilay Parekh
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
Celestine Omin
 
Linux GIT commands
Linux GIT commandsLinux GIT commands
Linux GIT commands
RajKumar Rampelli
 

What's hot (17)

Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
test
testtest
test
 
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
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git commands
Git commandsGit commands
Git commands
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
 
Git cheat-sheet-education
Git cheat-sheet-educationGit cheat-sheet-education
Git cheat-sheet-education
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
Git for developers
Git for developersGit for developers
Git for developers
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Git undo
Git undoGit undo
Git undo
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Linux GIT commands
Linux GIT commandsLinux GIT commands
Linux GIT commands
 

Similar to Git cheat sheet

Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and github
alidor4702
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git
GitGit
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
PravallikaTammisetty
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
github_gyan.pptx
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptx
AyushSingh931502
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
jaehyok Song
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
Marco De Stefano
 
Git cheat-sheet-education
Git cheat-sheet-educationGit cheat-sheet-education
Git cheat-sheet-education
ssuser0bad24
 
Techmoneyguide
TechmoneyguideTechmoneyguide
Techmoneyguide
Rockstartssl
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Jae Nwawe
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
leo_priv00
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
vartmp
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Augusto Gabriel Luna Bardales
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Adeel Munir
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
Nuno Caneco
 
GDSC GIT AND GITHUB
GDSC GIT AND GITHUB GDSC GIT AND GITHUB
GDSC GIT AND GITHUB
GDSCIIITDHARWAD
 

Similar to Git cheat sheet (20)

Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and github
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git
GitGit
Git
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Git github
Git githubGit github
Git github
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
github_gyan.pptx
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptx
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
Git cheat-sheet-education
Git cheat-sheet-educationGit cheat-sheet-education
Git cheat-sheet-education
 
Techmoneyguide
TechmoneyguideTechmoneyguide
Techmoneyguide
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
GDSC GIT AND GITHUB
GDSC GIT AND GITHUB GDSC GIT AND GITHUB
GDSC GIT AND GITHUB
 

More from Lam Hoang

Py spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.comPy spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.com
Lam Hoang
 
VS Code cheat sheet
VS Code cheat sheetVS Code cheat sheet
VS Code cheat sheet
Lam Hoang
 
PostgreSql cheat sheet
PostgreSql cheat sheetPostgreSql cheat sheet
PostgreSql cheat sheet
Lam Hoang
 
Nginx cheat sheet
Nginx cheat sheetNginx cheat sheet
Nginx cheat sheet
Lam Hoang
 
MySql cheat sheet
MySql cheat sheetMySql cheat sheet
MySql cheat sheet
Lam Hoang
 
Html cheat sheet
Html cheat sheetHtml cheat sheet
Html cheat sheet
Lam Hoang
 
Django cheat sheet
Django cheat sheetDjango cheat sheet
Django cheat sheet
Lam Hoang
 
Css cheat sheet
Css cheat sheetCss cheat sheet
Css cheat sheet
Lam Hoang
 
Apache cheat sheet
Apache cheat sheetApache cheat sheet
Apache cheat sheet
Lam Hoang
 
Battle chatter minecraft 1.4.7 mod
Battle chatter minecraft 1.4.7 modBattle chatter minecraft 1.4.7 mod
Battle chatter minecraft 1.4.7 mod
Lam Hoang
 
On thi dai_hoc_mon_van_2010 (1)
On thi dai_hoc_mon_van_2010 (1)On thi dai_hoc_mon_van_2010 (1)
On thi dai_hoc_mon_van_2010 (1)Lam Hoang
 
ôn thi môn văn
ôn thi môn vănôn thi môn văn
ôn thi môn vănLam Hoang
 
On thi dai_hoc_mon_van_2010
On thi dai_hoc_mon_van_2010On thi dai_hoc_mon_van_2010
On thi dai_hoc_mon_van_2010Lam Hoang
 
giáo trình c căn bản
giáo trình c căn bảngiáo trình c căn bản
giáo trình c căn bảnLam Hoang
 

More from Lam Hoang (14)

Py spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.comPy spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.com
 
VS Code cheat sheet
VS Code cheat sheetVS Code cheat sheet
VS Code cheat sheet
 
PostgreSql cheat sheet
PostgreSql cheat sheetPostgreSql cheat sheet
PostgreSql cheat sheet
 
Nginx cheat sheet
Nginx cheat sheetNginx cheat sheet
Nginx cheat sheet
 
MySql cheat sheet
MySql cheat sheetMySql cheat sheet
MySql cheat sheet
 
Html cheat sheet
Html cheat sheetHtml cheat sheet
Html cheat sheet
 
Django cheat sheet
Django cheat sheetDjango cheat sheet
Django cheat sheet
 
Css cheat sheet
Css cheat sheetCss cheat sheet
Css cheat sheet
 
Apache cheat sheet
Apache cheat sheetApache cheat sheet
Apache cheat sheet
 
Battle chatter minecraft 1.4.7 mod
Battle chatter minecraft 1.4.7 modBattle chatter minecraft 1.4.7 mod
Battle chatter minecraft 1.4.7 mod
 
On thi dai_hoc_mon_van_2010 (1)
On thi dai_hoc_mon_van_2010 (1)On thi dai_hoc_mon_van_2010 (1)
On thi dai_hoc_mon_van_2010 (1)
 
ôn thi môn văn
ôn thi môn vănôn thi môn văn
ôn thi môn văn
 
On thi dai_hoc_mon_van_2010
On thi dai_hoc_mon_van_2010On thi dai_hoc_mon_van_2010
On thi dai_hoc_mon_van_2010
 
giáo trình c căn bản
giáo trình c căn bảngiáo trình c căn bản
giáo trình c căn bản
 

Recently uploaded

BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
shahdabdulbaset
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
MiscAnnoy1
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 

Recently uploaded (20)

BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 

Git cheat sheet

  • 1. Git Cheat Sheet Git is a distributed version-control system for tracking changes in source code during software development. by lam 󰅂Con gure tooling Con gure user information for all local repositories Sets the name you want attached to your commit transactions git config --global use r.name "[name]" Sets the email you want attached to your commit transactions git config --global use r.email "[email addres s]" Enables helpful colorization of command line output git config --global col or.ui auto 󰅂Create repositories When starting out with a new repository, you only need to do it once; either locally, then push to GitHub, or by cloning an existing repository. Turn an existing directory into a git repository git init Clone (download) a repository that already exists on GitHub, including all of the les, branches, and commits git clone [url] 󰅂The .gitgnore le Sometimes it may be a good idea to exclude les from being tracked with Git. This is typically done in a special le named .gitignore . You can nd helpful templates for .gitignore les at github.com/github/gitignore. 󰅂Branches Branches are an important part of working with Git. Any commits you make will be made on the branch you're currently “checked out” to. Use git status to see which branch that is. Creates a new branch git branch [branch-nam e] Switches to the speci ed branch and updates the working directory git checkout [branch-na me] Combines the speci ed branch’s history into the current branch. This is usually done in pull requests but is an important Git operation. git merge [branch] Deletes the speci ed branch git branch -d [branch-n 󰅂 Synchronize changes Synchronize your local repository with the remote repository on GitHub.com Downloads all history from the remote tracking branches git fetch Combines remote tracking branch into current local branch git merge Uploads all local branch commits to GitHub git push Updates your current local working branch with all new 󰅂Make changes Browse and inspect the evolution of project les Lists version history for the current branch git log Lists version history for a le, including renames git log --follow [file] Shows content di erences between two branches git diff [first-branc h]...[second-branch] 󰏪 󰅢
  • 2. ame] commits from the corresponding remote branch on GitHub. git pull is a combination of git fetch and git merge  git pull Outputs metadata and content changes of the speci ed commit git show [commit] Snapshots the le in preparation for versioning git add [file] Records le snapshots permanently in version history git commit -m "[descrip tive message]" 󰅂Redo commits Erase mistakes and craft replacement history Undoes all commits after [commit], preserving changes locally git reset [commit] Discards all history and changes back to the speci ed commit git reset --hard [commi t] 󰅂Glossary an open source, distributed version-control system  git a platform for hosting and collaborating on Git repositories  GitHub a Git object, a snapshot of your entire repository compressed into a SHA  commit a lightweight movable pointer to a commit  branch a local version of a repository, including all commits and branches  clone a common repository on GitHub that all team member use to exchange their changes  remote a copy of a repository on GitHub owned by a di erent user  fork a place to compare and discuss the di erences introduced on a branch with reviews, comments, integrated tests, 󰏪 󰅢
  • 3. CheatSheetMaker.com SimpleCheatSheet.com and more  pull request representing your current working directory, the HEAD pointer can be moved to di erent branches, tags, or commits when using git checkout HEAD 󰏪 󰅢