Skip to content

Instantly share code, notes, and snippets.

@nonproto
Last active April 23, 2019 13:28
Show Gist options
  • Save nonproto/9839643c0bafc9e6de7816b0a3b12eae to your computer and use it in GitHub Desktop.
Save nonproto/9839643c0bafc9e6de7816b0a3b12eae to your computer and use it in GitHub Desktop.
Random Git Commands
Keeping a fork up to date
#1. Clone your fork:
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
2. Add remote from original repository in your forked repository:
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
3. Updating your fork from original repo to keep up with their changes:
git pull upstream master
Keep Pull Request up to date with rebase:
Do some work on a branch. When it's done, you'll probably find that you've fallen behind the main code base. Here's how to get it up to date:
git remote add upstream https://github.com/hrydgard/ppsspp.git (if you haven't already)
git fetch upstream
git rebase upstream/master
git submodule update
(fix any conflicts)
git push -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment