Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using GitLab. When I pushed up to prod last time, I later realized that there are many bugs. So, I git reset --hard kjh35kh3kh4k2h4k2h4.... to the earlier working commit. But now when I am trying to push it up to GitLab I am getting error master -> master (non-fast-forward) because hint:

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.

I tried to git push -f origin master, but than I get a different error GitLab: You are not allowed to force push code to a protected branch on this project. I do understand why it is happening, but how do I fix this cleanly? Should I git reset --hard kjh35kh3kh4k2h4k2h4.... on GitLab as well, if so how do I do that?

question from:https://stackoverflow.com/questions/65922409/git-reset-my-local-project-now-getting-error-when-pushing-to-live-server

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...