开发者

Can't commit changes to github

开发者 https://www.devze.com 2023-03-03 17:17 出处:网络
Whenever I try and to commit changes to my github repo I get this error. To git@github.com:antarr/3skeleton.git

Whenever I try and to commit changes to my github repo I get this error.

To git@github.com:antarr/3skeleton.git

! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to 'git@github.com:antarr/3skeleton.git'

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes (e.g. 'git pull') before pushing again.

See the 'Note about fast-forwards' section of 'git push --help' for details.

If I do git pull first, it changes some of the files on my m开发者_StackOverflowachine. Which kind of defeats the purpose.


It sounds like files have been committed and pushed to the repository on github since you last updated.

doing a git pull will pull those changes down and merge them in with your changes. You can then test everything and make sure it still works, and then do a push.

It should not overwrite the changes that you have made and are trying to commit.

0

精彩评论

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