【问题标题】:github committed files don't show up ongithub提交的文件不显示
【发布时间】:2012-02-24 09:20:29
【问题描述】:

新手问题:

我将一个文件添加到我的 repo(将它拖到我的 repo 文件夹)然后在 git bash 我“cd”到我的 repo 和“git init”、“git add filename”、“git commit -m 'committing files' ”。当我 git status 它说

$ git status
#on branch master
#your branch is ahead of origin master by 2 commits
#
working directory clean. Nothing to commit.

但是当我在我的 github 网站上刷新页面时,它们并没有出现在我的仓库中。我必须将它们推送到网站吗?

【问题讨论】:

    标签: github push


    【解决方案1】:

    我必须将它们推送到网站吗?

    是的。首先提交到您的本地存储库。您需要 git push origin master 才能将提交放在 GitHub 上。

    【讨论】:

    • 好的。这就是我的想法,但我质疑它,因为当我尝试这样做时,我收到了我需要输入密钥的消息。然后它给了我著名的公共访问被拒绝错误。我查看了其他论坛并确保我的 .ssh 文件存在,但仍然没有运气。我可以重置他们要求的密钥的密码吗?
    • 好的。因此,重置并设置新密码有效。 ssh-keygen
    【解决方案2】:

    您需要将更改推送到 github 上的远程。

    您已将更改提交到本地存储库 - 但这不会自动将它们推送到您的远程。试试这个:

    git push origin master
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-23
      • 1970-01-01
      • 2021-04-28
      • 2019-03-16
      • 2016-06-04
      • 2017-05-23
      • 1970-01-01
      • 2012-06-25
      相关资源
      最近更新 更多