yvi: Kaylee half-smiling, looking very pretty (Default)
yvi ([personal profile] yvi) wrote in [site community profile] dw_dev_training2012-09-02 07:29 pm
Entry tags:

More git newbie questions

So I managed to submit my first pull request \o/

However, i have the following problem, bets described in console output:

dh-yvi@newhack:~/dw$ git checkout develop
Switched to branch 'develop'
Your branch is ahead of 'dreamwidth/develop' by 68 commits.
dh-yvi@newhack:~/dw$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'dreamwidth/master' by 200 commits.

dh-yvi@newhack:~/dw$ git pull dreamwidth develop:develop
Already up-to-date.
dh-yvi@newhack:~/dw$ git pull dreamwidth master:master
From https://github.com/dreamwidth/dw-free
! [rejected] master -> master (non-fast-forward)
dh-yvi@newhack:~/dw$ git push origin develop
Everything up-to-date
dh-yvi@newhack:~/dw$ git push origin master
Everything up-to-date


What's going on there?
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2012-09-02 05:40 pm (UTC)(link)
"No fast forward" sounds like you committed things locally to your master branch. Things that exist there but that don't exist on the remote master branch. Is that true?
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2012-09-02 05:46 pm (UTC)(link)
Can you show me the output of the first commit in git log on your master and develop branches?
Edited 2012-09-02 17:46 (UTC)
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2012-09-02 05:52 pm (UTC)(link)
That looks in sync, then. The official repository also has 189bcec4fc851764e4324cfab6300a7bd2e087cd as the latest commit... I'm not sure why it would be saying you're ahead of the branches.

Can you show me your remotes?

git remote show origin
git remote show dreamwidth
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2012-09-02 06:17 pm (UTC)(link)
Okay, so, I think I see what's up.

The master branch is unused, generally speaking. We haven't been keeping up with it, so the last time master was updated was in May, with commit 1bd5c854b8ce2602cb032eba199202a6fe8b7b90.

However, it looks like somehow your master branch received the commits from develop. Perhaps from a pull from develop at some point. So on your local master, you now have a bunch of commits that master doesn't -- hence, you're 200 commits ahead of it.

This generally doesn't matter, since we never use master. The only thing that matters is develop, and from what I can tell, your develop branch seems fine. It only errored when you were working on the master branch.

So -- I'd suggest ignoring master and just using develop, since that's all we use anyway. Then you should be fine?

Edit: to fix this, you can do the following which destroys your master branch and replaces it with the one from dreamwidth:

git checkout master
git fetch dreamwidth
git reset --hard dreamwidth/master
Edited 2012-09-02 18:20 (UTC)