Git help needed


(Eric Shepherd) #1

Having trouble updating my fork of BCD to the current code. I’ve done a fetch and git reset --hard to update my local code, but when I try to push to my repository on github, this happens:

$ git push a2sheppy master
To github.com:a2sheppy/browser-compat-data.git
 ! [rejected]          master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:a2sheppy/browser-compat-data.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Anyone have any idea what to do? I’ve read the suggested instructions and followed steps within (trying a rebase etc) but no effect.

Sheppy


(Kairo) #2

did you do a git pull before trying to push?


(Judith rohatiner) #3

have you tried fetching from origin master first?

git fetch origin master

or

git rebase origin/master

then push changes from local.


(Eric Shepherd) #4

I followed a number of instructions including pulls and pushes and even a rebase. Finally @espressive suggested I do a git push -f to my master, and all is well. Hopefully. :slight_smile: