简体   繁体   English

Git提交不与Github同步

[英]Git commit not Syncing with Github

I am trying to commit a new file on git. 我正在尝试在git上提交新文件。

i created a new file in my Repo using below: touch help.txt git add help.txt git commit git push 我使用以下命令在仓库中创建了一个新文件:触摸help.txt git添加help.txt git提交git push

But it did not reflect in the github repo while the file is there in local repo. 但是当文件在本地存储库中时,它没有反映在github存储库中。

The reason and solution are in the output of git push . 原因和解决方案在git push的输出中。

Updates were rejected because the tip of your current branch is behind its remote counterpart. 由于当前分支的尖端位于其远程对应的后面,因此更新被拒绝。 Integrate the remote changes (eg 'git pull ...') before pushing again. 在再次推送之前,集成远程更改(例如“ git pull ...”)。 See the 'Note about fast-forwards' in 'git push --help' for details. 有关详细信息,请参见“ git push --help”中的“关于快进的注意事项”。

Your changes were rejected by the remote because it has changes that your local branch does not. 您的更改被远程拒绝,因为它具有本地分支所没有的更改。 You can do 你可以做

git pull --rebase origin name-of-branch-you-want-to-push-to git push origin name-of-branch-you-want-to-push-to

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

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