简体   繁体   中英

how to overwrite with a git push, overwrite changes to the git server?

We are pushing builds to heroku and would like to push without pulling in latest changes. I am essentially using the github repo as my source control repository and pushing to the git heroku repo from several different machines. Since we have a few build servers pushing to the same heroku repository sometimes a push of latest bits from a build server will throw a message saying I need to pull latest before committing and pushing.

However since the code from the build server is guaranteed to be the latest, I'd like to throw away the changes from the pull and just commit and push the files without a merge.

Is there a way to do this? Any other suggestions on how best to set this up?

Just do git push -f ( force push )

Pushing to heroku might be one of the valid use cases for git push -f , but still be careful and understand what you are doing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM