The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
-
Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)
git clone --bare [email protected]:some_username/reponame.git
-
Create a new private repository on Github and name it
myrepo. -
Mirror-push your bare clone to your new
myreporepository.cd reponame.git git push --mirror [email protected]:dweinber/myrepo.git
-
Remove the temporary local repository you created in step 1.
cd .. rm -rf reponame.git -
You can now clone your
myreporepository on your machine.git clone [email protected]:dweinber/myrepo.git
-
If you want, add the original repo as remote to fetch (potential) future changes. Make sure you also disable push on the remote (as you are not allowed to push to it anyway).
git remote add upstream [email protected]:some_username/reponame.git git remote set-url --push upstream DISABLE
You can list all your remotes with
git remote -v. You should see:origin [email protected]:dweinber/myrepo.git (fetch) origin [email protected]:dweinber/myrepo.git (push) upstream [email protected]:some_username/reponame.git (fetch) upstream DISABLE (push)When you push, do so on
originwithgit push origin.When you want to pull changes from
upstreamyou can just fetch the remote and rebase on top of your work.git fetch upstream git rebase upstream/master
And solve the conflicts if any