github devel question

Benjamin Root <ben.root@...553...> writes:

I am having difficulty completing a pull request that I opened. When I try
to merge the changes to upstream, they get rejected. I can merge it back to
my own master, and can even push it up to my github repo's master, but not
matplotlib's master.

If you're following the merge instructions at
<> and getting the merge rejected,
that's likely because your master branch is not up to date. The
instructions start with "git checkout master", but that assumes your
master is the same as matplotlib's master. If that is not the case, you
should first pull from matplotlib into your master - something like

git remote add upstream git@...679...:matplotlib/matplotlib.git
git checkout master
git pull --ff-only upstream master

The "remote add" is necessary only once, and it gives the name
"upstream" to the matplotlib central repository (and you have probably
already done it already if you're trying to push into the repository).
Then you checkout your master branch and pull into it from upstream. The
--ff-only flag makes sure that you get an error if you have accidentally
left something on your master that is not in upstream, possibly from
your earlier merge attempts. If you do get that error, the way to clear
it is

git reset --hard upstream/master

but beware that it discards any local changes (so always commit your own
changes on feature branches, not master). (If your changes are
something that you want to save, put them on a new branch first with
"git checkout -b important-local-changes; git commit -a", and then
checkout master again and reset it to upstream/master.)

Then, once your master is up to date, you can merge the pull request and
push to upstream.

I have tried rebasing my
branches, but that doesn't seem to solve the problem.

Rebasing branches that you have already pushed somewhere is to be
avoided - if you rebase your feature branch, I don't think e.g. github
will know that the pull request got merged.

I am thoroughly confused. Anybody has ideas? Should I dump my repos and
start fresh?

No, absolutely not. This is likely just a matter of merging into an
up-to-date master branch.


Jouni K. Sepp�nen