Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resolve a GitHub message that says the tip of my current branch is behind its remote counterpart?

I am trying to learn how to use GitHub to version-control my work as I go. (I work alone, no collaborators, no different branches, just me backing up my work as I go.) I have set up private Git repositories at BitBucket.org. I am using GitHub for OSX as my Git GUI.

But when I make edits to the files in my local Git repository on my hard drive, then use GitHub for OSX to try to "Commit & Sync," I get this error:

git: 'credential-osxkeychain' is not a git command. See 'git --help'.
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
2013-02-12 02:49:07.409 GitHub for Mac Login[44516:707] AskPass with arguments: (
    "/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
    "Password for 'https://[email protected]': "
)
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
To https://[email protected]/username/data.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/username/data.git'
hint: Updates were rejected because the tip of your current branch is behind its remote counterpart. Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details.
 (256)

(I edited the above to conceal my actual username.)

What does this mean, how do I resolve it, and how do I avoid getting it in the future?

like image 275
incandescentman Avatar asked Feb 12 '13 07:02

incandescentman


People also ask

How do you fix tip of current branch is behind?

The updates were rejected because the tip of your current branch is behind error can be fixed by pushing to a remote branch. This process is called a Git push, and it debugs the errors of the current branch, which is also known as a local branch.

How do I remove a remote git branch?

To delete a remote branch, you can't use the git branch command. Instead, use the git push command with --delete flag, followed by the name of the branch you want to delete. You also need to specify the remote name ( origin in this case) after git push .


1 Answers

Someone (or you) have updated the remote branch. That causes your remote branch become ahead of your current branch. (that is your local branch)

I suggest you to git pull --rebase origin master and push after that.

like image 109
ogzd Avatar answered Oct 21 '22 14:10

ogzd