Skip to content

Instantly share code, notes, and snippets.

@jmftrindade
Created March 24, 2019 02:17
Show Gist options
  • Save jmftrindade/afaa65fc721dd98c9ceae3bcaf197a0f to your computer and use it in GitHub Desktop.
Save jmftrindade/afaa65fc721dd98c9ceae3bcaf197a0f to your computer and use it in GitHub Desktop.
private fork

Clone repo

git clone --bare git@github.com:someuser/repo.git
cd repo.git
git push --mirror git@github.com:you/private.git
cd ..
rm -rf repo.git

Fetch changes from original repo

git remote add upstream git@github.com:someuser/repo.git
git pull upstream master  # creates a merge commit
git push origin master

PR to original repo

git clone git@github.com:someuser/repo.git
cd repo
git remote add private git@github.com:you/private.git
git checkout -b pr_yourchanges
git pull private master
git push origin pr_yourchanges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment