Friday, 6 December 2013

reset to one old commit on both local and remote computers

When using GitLab server, sometime I will reset to one old commit because I mess up in current commit.
On working computer, using this
git reset --hard 05a0753bd3e24922dd46bb6a04dc93dda9a9ec9f

Then try to push it to GitLab server, it doesn't work even if I push with --force option.
 remote: error: denying non-fast-forward refs/heads/develop (you should pull first)

Now the simplest way is to delete remote branch first, then push branch from local computer to GitLab server again.
git push origin :develop
git push origin develop

: means delete remote develop branch here.

No comments:

Followers

Contributors