Git: Branch is ahead by X commits. Doesn't help doing git pull
git
Solution
As mentioned in "Why is Git telling me “Your branch is ahead of 'origin/master' by 11 commits.” and how do I get it to stop?"
"your branch is ahead by..." => You need to push to the remote master. Run "`git diff origin/master`" to see what the differences are between your local repository and the remote master repository.
If you're ahead of the remote repo by one commit, it's the remote repo that's out of date, not you. Pulling wouldn't help.
Now check also if you are actually on a branch (and not on a detached head). This is your case here (you are indeed on `master` branch)
Problem
I do see other similar questions, but I dont really understand why this happens. For now, I am using `git reset --hard HEAD` then manually adding back my changes. The suggested solution seems to be `git pull origin master`? But I still get the same message after that. Whats wrong? How do I do a merge? I am still relatively new to GIT ``` $ git pull origin master Nodester! Enter passphrase for key '/home/jiewmeng/.ssh/id_rsa': From nodester.com:/node/git/jiewmeng/10267-f62c0a21d1a9d75ab7b6ace5858921d0 * branch master -> FETCH_HEAD Merge made by the 'recursive' strategy. $ git branch -a * master remotes/origin/master ```