I've contributed to many open source projects. Typically, as external contributors don't have write access to the repository they contribute to, the workflow is as follows:
- Fork the repo and
clone
a private copy git checkout -b feature-branch
on the forked repo- Push commits to this branch
- Open a pull request to merge
local:feature-branch
intoremote:master
This is all fine, but I've recently ran into a problem when there is a merge conflict forcing me to merge master
into my feature branch so the pull request can be accepted.
The command would typically be:
git checkout master
git pull origin master
git checkout feature-branch
git merge master
But when I go through these steps, git
displays Already up-to-date.
, which makes sense. Because I'm in a forked version of the repo, my copy will never be able to get the recent remote changes to master
.
So it looks like because I'm working on a forked copy that can't be merged, my PR is forever un-mergable.
How can I fix his problem?
Thanks so much for your help!