Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

gitlab - Git reset my local project, now getting error when pushing to live server

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...