I forked a repo on GitHub and submitted a pull request. The maintainers of the project rejected the pull request, but we worked out a better solution in a forum. They instructed me to create another pull request with the alternative changes. However, my fork of the repository on GitHub is now out-of-date, as updates have been pushed to the main repo since I forked. Also, the repository on GitHub has an extra commit (my pull request commit) that shouldn't be there, because it was not accepted as part of the project.
I found this question: How do I update a GitHub forked repository?
I followed the instructions, specifically, I did this:
git remote add upstream git://github.com/fuel/core
git fetch upstream
That resulted in:
remote: Counting objects: 93, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 69 (delta 49), reused 40 (delta 20)
Unpacking objects: 100% (69/69), done.
From git://github.com/fuel/core
* [new branch] 1.0/master -> upstream/1.0/master
* [new branch] 1.1/master -> upstream/1.1/master
* [new branch] 1.2/develop -> upstream/1.2/develop
* [new branch] 1.2/master -> upstream/1.2/master
* [new branch] 1.3/develop -> upstream/1.3/develop
* [new branch] 1.3/master -> upstream/1.3/master
* [new branch] 1.4/develop -> upstream/1.4/develop
* [new branch] 1.4/master -> upstream/1.4/master
* [new branch] 1.5/develop -> upstream/1.5/develop
* [new branch] 1.5/master -> upstream/1.5/master
* [new branch] 1.6/develop -> upstream/1.6/develop
* [new branch] feature/better-hmvc -> upstream/feature/better-hmvc
Okay, so that seems all fine and good. I made sure that I was on the correct branch:
git checkout 1.6/develop
Already on '1.6/develop'
Word. Okay, now for this:
git rebase upstream/1.6/develop
First, rewinding head to replay your work on top of it...
Applying: prevent invalid XML node names
Wait...what? Why is "prevent invalid XML node names" being applied? That is the pull request that was rejected by the project maintainers. I'm obviously missing the boat on the real meaning of "rebase." Now if I git status
it says:
# On branch 1.6/develop
nothing to commit (working directory clean)
When I git log
, I can see that half of my problem has been resolved. The changes that have been pulled into the project since I forked are now reflected in my git log
. However, the most recent commit remains "prevent invalid XML node names". How do I obliterate it?
I tried checking out the last commit made to the project:
git checkout 5f31a4df55e5b6ca1b2092534063a1fce4a32181
However, this leaves me in a detached HEAD state. It says I can look around, make changes and commit them. I don't think that's what I want to do. I think I want HEAD to point to commit 5f31a4df55e5b6ca1b2092534063a1fce4a32181. What is my next step?