Created
March 1, 2019 06:54
-
-
Save jawkha/6a4697633b171edcd120646d9045560e to your computer and use it in GitHub Desktop.
Useful Git commands for working with forks of other repos
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
To show all the remotes the repo is pointing to: | |
`git remote -v` | |
To add the upstream repo to the list of remotes: | |
`git remote add upstream <git@github.com:<repo-owner>/<repo-name.git>` | |
To fetch all the changes from upstream to the local repo: | |
`git fetch upstream` | |
To set up the master branch to track the remote master branch from upstream | |
`git branch --set-upstream-to=upstream/master master` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment