Last active
December 4, 2016 17:14
-
-
Save thombergs/950a1b0cde7383e73b3ee3c6d3920178 to your computer and use it in GitHub Desktop.
Git Cheat Sheet
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
| # clone the remote repo into a (automatically created) folder named like the repo | |
| git clone <FORK_URL> | |
| # list all registered remote repositories | |
| git remote -v | |
| # add the original repo as remote and name it "upstream" | |
| git remote add upstream <ORIGINAL_URL> | |
| # fetch the current state from the upstream remote | |
| git fetch upstream | |
| # change to local master | |
| git checkout master | |
| # merge all updates from upstream master branch into the local branch | |
| git merge upstream/master | |
| # push changes to remote fork | |
| git push | |
| # create a new branch | |
| git checkout -b <BRANCH_NAME> | |
| # push branch to a remote | |
| git push <REMOTE_NAME> <BRANCH_NAME> | |
| # list all local branches | |
| git branch -v | |
| # delete remote branch | |
| git push origin --delete <BRANCH_NAME> | |
| # delete local branch | |
| git branch -d <BRANCH_NAME> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment