开发者

"force" git commit on local to external via push? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Github first push problem… how to merge remote changes?

My external repo is fairly outdated. I want to push all my local changes up stream. However, when I 开发者_开发技巧attempt to do so I get the following message...

error: failed to push some refs to 'ssh://mylink'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.

I don't want to pull because if I do those external changes will mess up my local changes. How do I override the external?


git push --force remoterepository


What about simply overwriting your remote repo?


In my opinion, it's git's protected mechinism. because, someone has pushed sth before you, so you need to pull his reputation and build with your local changes to make sure there is no conflicts. so maybe you should try to pull someone's reputation first, and then push your changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜