git:无法将文件添加到github

时间:2015-07-18 12:44:36

标签: git github add

我发现了一些类似的问题。但我无法找到解决方案。

我使用以下命令将包含文件和子文件夹的文件夹添加到本地存储库:

git add .

然后用:

git commit -m "comment"

我明白了:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

问题是,我无法在github上找到这些文件。有什么想法吗?

编辑:

git push -u git@github.com:kamekame/wolke master

给出:

To git@github.com:kamekame/wolke
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:kamekame/wolke'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案:

git remote -v

给了我:

origin  git@github.com:kamekame/alpha.git (fetch)
origin  git@github.com:kamekame/alpha.git (push)

这与我的推送地址kamekame / wolke不同!

1 个答案:

答案 0 :(得分:4)

您需要设置本地仓库以将上游推送到您的github仓库。 来自:https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line

接下来的步骤将是:

div