Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to force push a reset to remote repository?
    text
    copied!<p>Our remote master branch somehow got messed up. Current development code is on the master branch along with the latest commits. Obviously, the development code is not ready for the master branch.</p> <p>So on my local repository, I did a reset to the latest tag, <code>git reset --hard (Tag)</code>. The master branch is now correct on my local repository. Now when I try to push the changes on to the remote repository, <code>git push origin master</code>, I get an error:</p> <pre><code>To (REMOTE GIT REPOSITORY LOCATION) ! [rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to '(REMOTE GIT REPOSITORY LOCATION)' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. </code></pre> <p>So after looking around I found out the <code>--force</code> option. So I did a force push on to the remote repository, <code>git push --force origin master</code>, and I still got an error:</p> <pre><code>Total 0 (delta 0), reused 0 (delta 0) remote: error: denying non-fast-forward refs/heads/master (you should pull first) To (REMOTE GIT REPOSITORY LOCATION) ! [remote rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to '(REMOTE GIT REPOSITORY LOCATION)' </code></pre> <p>I can't do a pull on master, because it contains development code which can't be on master. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload