Benjamin Root <ben.r...@ou.edu> 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
<http://help.github.com/pull-requests/> 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 g...@github.com: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
http://www.iki.fi/jks


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to