无法将新更改从本地存储库推送到远程github

时间:2019-07-12 04:46:30

标签: git git-push

我创建了一个存储库,并将其添加到本地github,但是我无法将本地更改推送到远程github存储库。我在做什么错了?

返回错误(即,在以下命令之后此状态永远不会更改,并且github.com上的文件不会更改)

git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   README.md

我尝试了以下所有操作:

git push --all -u
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:xxx.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts     (/home/leo/.ssh/known_hosts).
Branch 'master' set up to track remote branch 'master' from 'origin'.
Everything up-to-date

git push -u origin master

git push origin --all

git push origin master

git push origin master:master

git push

git push --all

git add .

1 个答案:

答案 0 :(得分:0)

似乎您已进行了未提交的更改。其他所有内容都与远程存储库相同,但是一旦提交更改,就会有一些推送。

git commit -a -m "Modified README"

-a选项添加所有已更改的文件以提交。 -m选项设置一条消息。

要验证这一点,可以添加推命令的输出以提供更多信息。在执行commit命令之后,您的push命令应该可以工作。

相关问题