Re: Your branch is ahead of 'origin/master' by 1 commit.
Re: Your branch is ahead of 'origin/master' by 1 commit.
- Subject: Re: Your branch is ahead of 'origin/master' by 1 commit.
- From: Jens Alfke <email@hidden>
- Date: Thu, 12 Sep 2013 12:32:53 -0700
On Sep 11, 2013, at 8:25 PM, Jerry Krinock < email@hidden> wrote:
Anyhow, for the few days, regarding an open-source repo of mine on github.com, I've been getting this when I attempt to "Commit"… Git Error: Your branch is ahead of 'origin/master' by 1 commit.
You sure this wasn’t when you pushed? Commit is a purely local operation and shouldn’t be affected by anything that happened on Github. Does it make sense that this problem was caused by me adding the ReadMe on github.com?
Yup. When you modify files in the Github web UI, it’s actually committing a new revision to the repository, just as though someone else had checked out your project and made a commit and pushed it.
Then why did the error say "Your branch is ahead of origin/master"? I presume that "my branch" is on my Mac, and 'origin/master' is on github.com. I would say that I was "behind", not "ahead".
Well, neither ‘ahead’ nor ‘behind’ really applies; they’re just _different_. Each of them has a new different commit at its head. By default ‘git push’ won’t create a new head on a destination repo, so it gives you an error instead. Then you do what you did — pull the remote change, merge if necessary, and then push.
(A tip: Use “git pull --rebase”. It’ll end up with a linear history with the remote changes coming first and then your new un-pushed ones. A regular pull will use a merge, which makes the history look branchy and harder to follow.)
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden