Let's say the parent repo has a feature branch called partitions
- Fork the repo, Sync.
- Manually create branch
partitions
at the forked repo. - Click on sync fork.
- Create local branch
partitions
git checkout -b partitions
- Set upstream to origin/partitions
git branch -u origin/partitions
// branch 'partitions' set up to track 'origin/partitions'.
- Now, the local branch could be very different from the tracking branch. In this case, we don't mind having conflicts, the goal is to sync.
Your branch and 'origin/partitions' have diverged,
and have 187 and 4 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)
- Tell Git to reset the head of
partitions
to the same commit asorigin/partitions
, and update the working tree to match.
git reset --hard origin/partitions
- Now, create a new branch to start my work.
git checkout -b partitions-1
- Make changes and commit.
- Push.
git push --set-upstream origin partition-1