我发现了一些类似的问题。但我找不到解决办法。
我使用以下命令将包含文件和子文件夹的文件夹添加到我的本地存储库:
git add .
Run Code Online (Sandbox Code Playgroud)
然后用:
git commit -m "comment"
Run Code Online (Sandbox Code Playgroud)
我得到:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)
问题是,我在github上找不到文件。有任何想法吗?
编辑:
git push -u git@github.com:kamekame/wolke master
Run Code Online (Sandbox Code Playgroud)
给出:
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.
Run Code Online (Sandbox Code Playgroud)
解决方案:
git remote -v
Run Code Online (Sandbox Code Playgroud)
给我:
origin git@github.com:kamekame/alpha.git (fetch)
origin git@github.com:kamekame/alpha.git (push)
Run Code Online (Sandbox Code Playgroud)
这与我的推送地址 kamekame/wolke 不同!
您需要设置本地存储库以将上游推送到您的 github 存储库。来自:https : //help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line
您的下一步将是:
# create repo via github ui or github cli
# add github as the origin
git remote add origin remote_repository_URL
# push changes to repo
git push origin master
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3676 次 |
最近记录: |