SlideShare a Scribd company logo
Git Basics
Undoing Changes
git init
<directory>
git clone <repo>
git config
user.name <name>
git add
<directory>
git commit -m
"<message>"
git status
git log
git diff
Create empty Git repo in specified directory. Run with no arguments to
initialize the current directory as a git repository.
Clone repo located at <repo> onto local machine. Original repo can be
located on the local filesystem or on a remote machine via HTTP or SSH.
Define author name to be used for all commits in current repo. Devs
commonly use --global flag to set config options for current user.
Stage all changes in <directory> for the next commit. Replace <directory>
with a <file> to change a specific file.
Commit the staged snapshot, but instead of launching a text editor, use
<message> as the commit message.
List which files are staged, unstaged, and untracked.
Display the entire commit history using the default format. For
customization see additional options.
Show unstaged changes between your index and working
directory
Create new commit that undoes all of the changes made in
<commit>, then apply it to the current branch.
git revert
<commit>
Remove <file> from the staging area, but leave the working directory
unchanged. This unstages a file without overwriting any changes.
git reset <file>
Shows which files would be removed from working directory. Use the -f
flag in place of the -n flag to execute the clean.
git clean -n
+
Git Branches
Remote Repositories
Rewriting Git History
Replace the last commit with the staged changes and last commit
combined. Use with nothing staged to edit the last commit’s message.
git commit --amend
Rebase the current branch onto <base>. <base> can be a commit
ID, a branch name, a tag, or a relative reference to HEAD.
git rebase <base>
Show a log of changes to the local repository's HEAD. Add --relative-
date flag to show date info or --all to show all refs.
git reflog
List all of the branches in your repo. Add a <branch> argument to
create a new branch with the name <branch>.
git branch
Create and check out a new branch named <branch>. Drop the -b
flag to checkout an existing branch.
git checkout -b
<branch>
Merge <branch> into the current branch.git merge <branch>
Create a new connection to a remote repo. After adding a remote, you
can use <name> as a shortcut for <url> in other commands.
git remote add
<name> <url>
Fetches a specific <branch>, from the repo. Leave off <branch> to
fetch all remote refs.
git fetch
<remote> <branch>
Fetch the specified remote’s copy of current branch and immediately
merge it into the local copy.
git pull <remote>
Push the branch to <remote>, along with necessary commits and
objects. Creates named branch in the remote repo if it doesn’t exist.
git push <remote>
<branch>
Git Cheat Sheet
Visit atlassian.com/git for more information, training, and tutorials page 1
+
+
+
+ +
+
+
git config git diff
git log
git reset
git rebase
git pull
git push
Additional Options +
Define the author name to be used for all commits by the current user.
git config --global
user.name <name>
Define the author email to be used for all commits by the current user.
git config --global
user.email <email>
Create shortcut for a Git command. E.g. alias.glog "log --graph
--oneline" will set "git glog" equivalent to "git log --graph --oneline"
git config --global
alias.<alias-name>
<git-command>
Set text editor used by commands for all users on the machine. <editor>
arg should be the command that launches the desired editor (e.g., vi).
git config --system
core.editor
<editor>
Open the global configuration file in a text editor for manual editing.git config --global
--edit
git log -<limit>
git log --oneline
git log --stat
git log -p
git log
--author="<pattern>"
git log
--grep="<pattern>"
git log
<since>..<until>
git log -- <file>
git log --graph
--decorate
Limit number of commits by <limit> . E.g. "git log -5" will limit to 5
commits
Condense each commit to a single line.
Include which files were altered and the relative number of lines that
were added or deleted from each of them.
Display the full diff of each commit.
Search for commits by a particular author.
Search for commits with a commit message that matches
<pattern>.
Show commits that occur between <since> and <until>. Args can be a
commit ID, branch name, HEAD, or any other kind of revision reference.
Show difference between working directory and last commit.
Only display commits that have the specified file.
--graph flag draws a text based graph of commits on left side of commit
msgs. --decorate adds names of branches or tags of commits shown.
git diff HEAD
Show difference between staged changes and last commit.git diff --cached
Reset staging area to match most recent commit, but leave the working
directory unchanged.
git reset
Reset staging area and working directory to match most recent commit
and overwrites all changes in the working directory.
git reset --hard
Move the current branch tip backward to <commit>, reset the staging
area to match, but leave the working directory alone.git reset <commit>
Same as previous, but resets both the staging area & working directory to
match. Deletes uncommitted changes, and all commits after <commit>.
git reset --hard
<commit>
Interactively rebase current branch onto <base>. Launches editor to enter
commands for how each commit will be transferred to the new base.
git rebase -i
<base>
Fetch the remote’s copy of current branch and rebases it into the local
copy. Uses git rebase instead of merge to integrate the branches.
git pull --rebase
<remote>
Forces the git push even if it results in a non-fast-forward merge. Do not
use the --force flag unless you’re absolutely sure you know what you’re doing.
git push <remote>
--force
Push all of your local branches to the specified remote.git push <remote>
--all
Tags aren’t automatically pushed when you push a branch or use the
--all flag. The --tags flag sends all of your local tags to the remote repo.
git push <remote>
--tags
Visit atlassian.com/git for more information, training, and tutorials page 2
Ad

More Related Content

What's hot (20)

SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
Gracy Joseph
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Md Swawibe Ul Alam
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
Nishan Bose
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
LeoulZewelde1
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Park JoongSoo
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
jstack
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
 
git and github
git and githubgit and github
git and github
Darren Oakley
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
 
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
Jui An Huang (黃瑞安)
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
「Docker +VLAN 環境」アプリケーション実行環境の構築
「Docker +VLAN 環境」アプリケーション実行環境の構築「Docker +VLAN 環境」アプリケーション実行環境の構築
「Docker +VLAN 環境」アプリケーション実行環境の構築
Fuva Brain
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
Sourabh Sahu
 
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
Gracy Joseph
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Md Swawibe Ul Alam
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
Nishan Bose
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Park JoongSoo
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
jstack
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
「Docker +VLAN 環境」アプリケーション実行環境の構築
「Docker +VLAN 環境」アプリケーション実行環境の構築「Docker +VLAN 環境」アプリケーション実行環境の構築
「Docker +VLAN 環境」アプリケーション実行環境の構築
Fuva Brain
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
Sourabh Sahu
 

Viewers also liked (6)

Web testing
Web testingWeb testing
Web testing
Abdul Basit
 
A Survey Of Agile Development Methodologies
A Survey Of Agile Development MethodologiesA Survey Of Agile Development Methodologies
A Survey Of Agile Development Methodologies
Abdul Basit
 
White box testing
White box testingWhite box testing
White box testing
Abdul Basit
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Abdul Basit
 
Testing the documentation
Testing the documentationTesting the documentation
Testing the documentation
Abdul Basit
 
Requirement modeling
Requirement modelingRequirement modeling
Requirement modeling
Abdul Basit
 
A Survey Of Agile Development Methodologies
A Survey Of Agile Development MethodologiesA Survey Of Agile Development Methodologies
A Survey Of Agile Development Methodologies
Abdul Basit
 
White box testing
White box testingWhite box testing
White box testing
Abdul Basit
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Abdul Basit
 
Testing the documentation
Testing the documentationTesting the documentation
Testing the documentation
Abdul Basit
 
Requirement modeling
Requirement modelingRequirement modeling
Requirement modeling
Abdul Basit
 
Ad

Similar to Atlassian git cheatsheet (20)

Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
Marco De Stefano
 
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 and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
Lam Hoang
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
synapsefre
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
Jason Byrne
 
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 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
Jesús Miguel Benito Calzada
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
PravallikaTammisetty
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
Weghlis Azzariou
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
Abdul Basit
 
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
Augusto Gabriel Luna Bardales
 
Github git-cheat-sheet
Github git-cheat-sheetGithub git-cheat-sheet
Github git-cheat-sheet
Adeel Munir
 
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
leo_priv00
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Ananth Kumar
 
Ad

More from Abdul Basit (20)

Testing software security
Testing software securityTesting software security
Testing software security
Abdul Basit
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
Abdul Basit
 
Test planning
Test planningTest planning
Test planning
Abdul Basit
 
Test cases planning
Test cases planningTest cases planning
Test cases planning
Abdul Basit
 
Software Testing
Software TestingSoftware Testing
Software Testing
Abdul Basit
 
Software Compatibility testing
Software Compatibility testingSoftware Compatibility testing
Software Compatibility testing
Abdul Basit
 
Black box testing
Black box testingBlack box testing
Black box testing
Abdul Basit
 
Software Automated testing and tools
Software Automated testing and toolsSoftware Automated testing and tools
Software Automated testing and tools
Abdul Basit
 
Why test software
Why test softwareWhy test software
Why test software
Abdul Basit
 
Static white box testing lecture 12
Static white box testing lecture 12Static white box testing lecture 12
Static white box testing lecture 12
Abdul Basit
 
Software testing lecture 10
Software testing lecture 10Software testing lecture 10
Software testing lecture 10
Abdul Basit
 
Software testing lecture 9
Software testing lecture 9Software testing lecture 9
Software testing lecture 9
Abdul Basit
 
Software quality assurance lecture 1
Software quality assurance lecture 1Software quality assurance lecture 1
Software quality assurance lecture 1
Abdul Basit
 
Software measurement lecture 7
Software measurement lecture 7Software measurement lecture 7
Software measurement lecture 7
Abdul Basit
 
Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6
Abdul Basit
 
Managing software quality in an organization lecture 3
Managing software quality in an organization lecture 3Managing software quality in an organization lecture 3
Managing software quality in an organization lecture 3
Abdul Basit
 
Function of software quality assurance lecture 2
Function of software quality assurance lecture 2Function of software quality assurance lecture 2
Function of software quality assurance lecture 2
Abdul Basit
 
Expectation from qms lecture 5
Expectation from qms lecture 5Expectation from qms lecture 5
Expectation from qms lecture 5
Abdul Basit
 
Capability maturity model cmm lecture 8
Capability maturity model cmm lecture 8Capability maturity model cmm lecture 8
Capability maturity model cmm lecture 8
Abdul Basit
 
Black box testing lecture 11
Black box testing lecture 11Black box testing lecture 11
Black box testing lecture 11
Abdul Basit
 
Testing software security
Testing software securityTesting software security
Testing software security
Abdul Basit
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
Abdul Basit
 
Test cases planning
Test cases planningTest cases planning
Test cases planning
Abdul Basit
 
Software Testing
Software TestingSoftware Testing
Software Testing
Abdul Basit
 
Software Compatibility testing
Software Compatibility testingSoftware Compatibility testing
Software Compatibility testing
Abdul Basit
 
Black box testing
Black box testingBlack box testing
Black box testing
Abdul Basit
 
Software Automated testing and tools
Software Automated testing and toolsSoftware Automated testing and tools
Software Automated testing and tools
Abdul Basit
 
Why test software
Why test softwareWhy test software
Why test software
Abdul Basit
 
Static white box testing lecture 12
Static white box testing lecture 12Static white box testing lecture 12
Static white box testing lecture 12
Abdul Basit
 
Software testing lecture 10
Software testing lecture 10Software testing lecture 10
Software testing lecture 10
Abdul Basit
 
Software testing lecture 9
Software testing lecture 9Software testing lecture 9
Software testing lecture 9
Abdul Basit
 
Software quality assurance lecture 1
Software quality assurance lecture 1Software quality assurance lecture 1
Software quality assurance lecture 1
Abdul Basit
 
Software measurement lecture 7
Software measurement lecture 7Software measurement lecture 7
Software measurement lecture 7
Abdul Basit
 
Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6
Abdul Basit
 
Managing software quality in an organization lecture 3
Managing software quality in an organization lecture 3Managing software quality in an organization lecture 3
Managing software quality in an organization lecture 3
Abdul Basit
 
Function of software quality assurance lecture 2
Function of software quality assurance lecture 2Function of software quality assurance lecture 2
Function of software quality assurance lecture 2
Abdul Basit
 
Expectation from qms lecture 5
Expectation from qms lecture 5Expectation from qms lecture 5
Expectation from qms lecture 5
Abdul Basit
 
Capability maturity model cmm lecture 8
Capability maturity model cmm lecture 8Capability maturity model cmm lecture 8
Capability maturity model cmm lecture 8
Abdul Basit
 
Black box testing lecture 11
Black box testing lecture 11Black box testing lecture 11
Black box testing lecture 11
Abdul Basit
 

Recently uploaded (20)

Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 

Atlassian git cheatsheet

  • 1. Git Basics Undoing Changes git init <directory> git clone <repo> git config user.name <name> git add <directory> git commit -m "<message>" git status git log git diff Create empty Git repo in specified directory. Run with no arguments to initialize the current directory as a git repository. Clone repo located at <repo> onto local machine. Original repo can be located on the local filesystem or on a remote machine via HTTP or SSH. Define author name to be used for all commits in current repo. Devs commonly use --global flag to set config options for current user. Stage all changes in <directory> for the next commit. Replace <directory> with a <file> to change a specific file. Commit the staged snapshot, but instead of launching a text editor, use <message> as the commit message. List which files are staged, unstaged, and untracked. Display the entire commit history using the default format. For customization see additional options. Show unstaged changes between your index and working directory Create new commit that undoes all of the changes made in <commit>, then apply it to the current branch. git revert <commit> Remove <file> from the staging area, but leave the working directory unchanged. This unstages a file without overwriting any changes. git reset <file> Shows which files would be removed from working directory. Use the -f flag in place of the -n flag to execute the clean. git clean -n + Git Branches Remote Repositories Rewriting Git History Replace the last commit with the staged changes and last commit combined. Use with nothing staged to edit the last commit’s message. git commit --amend Rebase the current branch onto <base>. <base> can be a commit ID, a branch name, a tag, or a relative reference to HEAD. git rebase <base> Show a log of changes to the local repository's HEAD. Add --relative- date flag to show date info or --all to show all refs. git reflog List all of the branches in your repo. Add a <branch> argument to create a new branch with the name <branch>. git branch Create and check out a new branch named <branch>. Drop the -b flag to checkout an existing branch. git checkout -b <branch> Merge <branch> into the current branch.git merge <branch> Create a new connection to a remote repo. After adding a remote, you can use <name> as a shortcut for <url> in other commands. git remote add <name> <url> Fetches a specific <branch>, from the repo. Leave off <branch> to fetch all remote refs. git fetch <remote> <branch> Fetch the specified remote’s copy of current branch and immediately merge it into the local copy. git pull <remote> Push the branch to <remote>, along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist. git push <remote> <branch> Git Cheat Sheet Visit atlassian.com/git for more information, training, and tutorials page 1 + + + + + + +
  • 2. git config git diff git log git reset git rebase git pull git push Additional Options + Define the author name to be used for all commits by the current user. git config --global user.name <name> Define the author email to be used for all commits by the current user. git config --global user.email <email> Create shortcut for a Git command. E.g. alias.glog "log --graph --oneline" will set "git glog" equivalent to "git log --graph --oneline" git config --global alias.<alias-name> <git-command> Set text editor used by commands for all users on the machine. <editor> arg should be the command that launches the desired editor (e.g., vi). git config --system core.editor <editor> Open the global configuration file in a text editor for manual editing.git config --global --edit git log -<limit> git log --oneline git log --stat git log -p git log --author="<pattern>" git log --grep="<pattern>" git log <since>..<until> git log -- <file> git log --graph --decorate Limit number of commits by <limit> . E.g. "git log -5" will limit to 5 commits Condense each commit to a single line. Include which files were altered and the relative number of lines that were added or deleted from each of them. Display the full diff of each commit. Search for commits by a particular author. Search for commits with a commit message that matches <pattern>. Show commits that occur between <since> and <until>. Args can be a commit ID, branch name, HEAD, or any other kind of revision reference. Show difference between working directory and last commit. Only display commits that have the specified file. --graph flag draws a text based graph of commits on left side of commit msgs. --decorate adds names of branches or tags of commits shown. git diff HEAD Show difference between staged changes and last commit.git diff --cached Reset staging area to match most recent commit, but leave the working directory unchanged. git reset Reset staging area and working directory to match most recent commit and overwrites all changes in the working directory. git reset --hard Move the current branch tip backward to <commit>, reset the staging area to match, but leave the working directory alone.git reset <commit> Same as previous, but resets both the staging area & working directory to match. Deletes uncommitted changes, and all commits after <commit>. git reset --hard <commit> Interactively rebase current branch onto <base>. Launches editor to enter commands for how each commit will be transferred to the new base. git rebase -i <base> Fetch the remote’s copy of current branch and rebases it into the local copy. Uses git rebase instead of merge to integrate the branches. git pull --rebase <remote> Forces the git push even if it results in a non-fast-forward merge. Do not use the --force flag unless you’re absolutely sure you know what you’re doing. git push <remote> --force Push all of your local branches to the specified remote.git push <remote> --all Tags aren’t automatically pushed when you push a branch or use the --all flag. The --tags flag sends all of your local tags to the remote repo. git push <remote> --tags Visit atlassian.com/git for more information, training, and tutorials page 2
  翻译: