Skip to content

divvjson/git-cheat-sheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

Git Cheat Sheet

Branches

Create branch
git branch feature-1

Go to branch
git checkout feature-1

Merge feature-1 to master
git checkout master
git pull origin master
git merge feature-1
(solve potential merge conflicts ...)
git push origin master

Remove local branch
git branch -D feature-1

Remove remote branch
git push origin --delete feature-1

Merge master into branch
git checkout master
git pull origin master
git checkout feature-1
git merge master

Changes

Undo changes (not commited)
git stash (save local changes)
git reset --hard (discard local changes)

Undo changes (commited)
git reflog
Note down the ID of the commit we want to go back to, e.g. 6b6271a
git reset --hard 6b6271a

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published