Last active
March 24, 2020 09:07
-
-
Save thomashartm/062c1a501f3d1ee93d10c94bf6f52bfb to your computer and use it in GitHub Desktop.
Git commonly used commands cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################## | |
# fetches all branches and commits from remote in this case origin | |
git fetch origin | |
######################## | |
# show local branches | |
git branch | |
# shows alsp remote branches | |
git branch -r | |
######################## | |
# Checkout local branch | |
git checkout develop | |
# Checkout and track a remote branch from origin in this case develop | |
git checkout --track origin/develop | |
# create new branch | |
git checkout -b branchname develop | |
# Removing a branch | |
git branch -D branchname | |
######################## | |
# merge a branch named feature/myfeaturebranch into develop | |
git checkout develop | |
git merge --no-ff -m "Merged feature/myfeaturebranch into develop" feature/myfeaturebranch | |
######################## | |
# push all changes and all tags | |
git push --all && git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment