【发布时间】:2015-07-18 12:44:36
【问题描述】:
我发现了一些类似的问题。但我找不到解决办法。
我使用以下方法将包含文件和子文件夹的文件夹添加到本地存储库:
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 不同!
【问题讨论】:
-
嗯,你需要推动。 commit 只会将提交添加到您的本地存储库。 git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
-
运行
git pull先同步 -
git pull --> 已经更新了!这也无济于事。 ://