Skip to main content
Link to Git manpages at https://git-scm.com/docs/ - canonical version
Source Link
Jakub Narębski
  • 327.4k
  • 67
  • 229
  • 234

If forcing a push doesn't help (git push --force origin or git push --force origin master should be enough), it might mean that the remote server is refusing non fast-forward pushes, via either receive.denyNonFastForwards config variable (see git configgit config manpage for description), or via an update/pre-receive hook.

With older Git you can work around that restriction by deleting git push origin :master (note the : before branch name) and then re-creating git push origin master given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit revertingreverting changes in D-E-F:

A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help (git push --force origin or git push --force origin master should be enough), it might mean that the remote server is refusing non fast-forward pushes, via either receive.denyNonFastForwards config variable (see git config manpage for description), or via an update/pre-receive hook.

With older Git you can work around that restriction by deleting git push origin :master (note the : before branch name) and then re-creating git push origin master given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help (git push --force origin or git push --force origin master should be enough), it might mean that the remote server is refusing non fast-forward pushes, via either receive.denyNonFastForwards config variable (see git config manpage for description), or via an update/pre-receive hook.

With older Git you can work around that restriction by deleting git push origin :master (note the : before branch name) and then re-creating git push origin master given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 
Normalise formatting
Source Link
Lee Goddard
  • 11.3k
  • 5
  • 53
  • 71

If forcing a push doesn't help ("git push --force origin" or "git push --force origin master" should be enough), it might mean that the remote server is refusing non fast-forward pushes either, via receive.denyNonFastForwardseither receive.denyNonFastForwards config variable (see git config manpage for description), or via an update  / prepre-receive hook.

With older Git you can work around that restriction by deleting "git push origin :master" (seenote the ':': before branch name) and then re-creating "git push origin master" given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

 A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help ("git push --force origin" or "git push --force origin master" should be enough), it might mean that the remote server is refusing non fast-forward pushes either via receive.denyNonFastForwards config variable (see git config manpage for description), or via update  / pre-receive hook.

With older Git you can work around that restriction by deleting "git push origin :master" (see the ':' before branch name) and then re-creating "git push origin master" given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

 A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help (git push --force origin or git push --force origin master should be enough), it might mean that the remote server is refusing non fast-forward pushes, via either receive.denyNonFastForwards config variable (see git config manpage for description), or via an update/pre-receive hook.

With older Git you can work around that restriction by deleting git push origin :master (note the : before branch name) and then re-creating git push origin master given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 
deleted 36 characters in body
Source Link
Henrik
  • 10k
  • 6
  • 56
  • 89

If forcing a push doesn't help ("git push --force origin" or "git push --force origin master" should be enough), it might mean that the remote server is refusing non fast-forward pushes either via receive.denyNonFastForwards config variable (see git configgit config manpage for description), or via update / pre-receive hook.

With older Git you can work around that restriction by deleting "git push origin :master" (see the ':' before branch name) and then re-creating "git push origin master" given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit revertingreverting changes in D-E-F:

 A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help ("git push --force origin" or "git push --force origin master" should be enough), it might mean that the remote server is refusing non fast-forward pushes either via receive.denyNonFastForwards config variable (see git config manpage for description), or via update / pre-receive hook.

With older Git you can work around that restriction by deleting "git push origin :master" (see the ':' before branch name) and then re-creating "git push origin master" given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

 A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 

If forcing a push doesn't help ("git push --force origin" or "git push --force origin master" should be enough), it might mean that the remote server is refusing non fast-forward pushes either via receive.denyNonFastForwards config variable (see git config manpage for description), or via update / pre-receive hook.

With older Git you can work around that restriction by deleting "git push origin :master" (see the ':' before branch name) and then re-creating "git push origin master" given branch.

If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:

 A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master 
Source Link
Jakub Narębski
  • 327.4k
  • 67
  • 229
  • 234
Loading