# Git help needed

**URL:** <https://discourse.mozilla.org/t/git-help-needed/29334>\
**Category:** MDN\
**Created:** [June 12, 2018, 2:51pm UTC](https://discourse.mozilla.org/t/git-help-needed/29334 "2018-06-12T14:51:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheppy](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/sheppy/32/20903_2.png) [@sheppy](https://discourse.mozilla.org/u/sheppy)\
**Post date:** [June 12, 2018, 2:51pm UTC](https://discourse.mozilla.org/t/git-help-needed/29334/1 "2018-06-12T14:51:55Z")

</div>

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:

```auto
$ 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

---

<div class="post-metadata">

**Author:** ![KaiRo](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/kairo/32/37668_2.png) [@KaiRo](https://discourse.mozilla.org/u/KaiRo)\
**Post date:** [June 12, 2018, 4:31pm UTC](https://discourse.mozilla.org/t/git-help-needed/29334/2 "2018-06-12T16:31:37Z")

</div>

did you do a `git pull` before trying to push?

---

<div class="post-metadata">

**Author:** ![jrohatiner](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jrohatiner/32/23550_2.png) [@jrohatiner](https://discourse.mozilla.org/u/jrohatiner)\
**Post date:** [June 12, 2018, 4:35pm UTC](https://discourse.mozilla.org/t/git-help-needed/29334/3 "2018-06-12T16:35:26Z")

</div>

have you tried fetching from origin master first?

git fetch origin master

or

git rebase origin/master

then push changes from local.

---

<div class="post-metadata">

**Author:** ![sheppy](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/sheppy/32/20903_2.png) [@sheppy](https://discourse.mozilla.org/u/sheppy)\
**Post date:** [June 12, 2018, 4:45pm UTC](https://discourse.mozilla.org/t/git-help-needed/29334/4 "2018-06-12T16:45:43Z")

</div>

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. 🙂
