繁体   English   中英

如何将更改推送到 github

[英]How to push changes to github

我设计了我的网络应用程序,现在我想将更改推送到我的存储库。

我尝试了git push orgin master orgin git push orgin master并正确输入了我的用户名/密码并收到此错误:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/username/project.git'
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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

所以我尝试了git pull orgin master (它成功下载了另一个用户添加的更改),然后我重新尝试了git push orgin master和相同的结果。 再次。

我也试过

git init
git add .
git commit -m "Styled notifications"

想到的唯一解释是,在您拉取和推送之间,其他人将新提交推送到远程master分支。 你能不能快速连续尝试以下两个命令:

git pull origin master
git push origin master

请注意, git pull会将远程的更改合并到您的本地分支中,但另一种方法是改用变基:

git pull --rebase origin master

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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