1
我已經提交併將我的更改推送到github.com,但是當我刪除本地目錄並將該repo克隆到本地計算機時,我得到一組反映在上次提交中添加新文件以及上次提交中刪除的文件缺失。我在做什麼不是 get是在上次提交中修改的文件,也就是我收到的文件,但它們是舊版本。推送並提交給github,但顯然只有一些變化
我還需要做什麼其他步驟?
之後,我對自述文件做了一個小小的編輯,我注意到有一個消息「你的分支在1位提交'之前是'origin/master'。」這是什麼意思,我該如何解決它
[email protected]:~/backup9$ git commit
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
modified: README.md
no changes added to commit
[email protected]:~/backup9$ git add README.md
[email protected]:~/backup9$ git commit
[master b4c856a] Improve the formatting of README.md.
1 file changed, 22 insertions(+), 5 deletions(-)
[email protected]:~/backup9$ git push https://github.com/H2ONaCl/backup9.git master
Username for 'https://github.com': H2ONaCl
Password for 'https://[email protected]':
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 509 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To https://github.com/H2ONaCl/backup9.git
f082024..b4c856a master -> master
[email protected]:~/backup9$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
編輯:?我刪除了目錄,並再次克隆似乎正在從GitHub收到README.md修改,但是修改其他文件都沒有,也就是說,其他文件仍然是舊版本。
是的,但在之前的序列中未顯示,我添加的文件,刪除的文件,並修改文件。添加和刪除可用於重新克隆,但不能進行修改。 – H2ONaCl
@ H2ONaCl當然:下次嘗試'git add -A .',看看它是否更好。請檢查這些文件是否被'git check-ignore -v - myfile'忽略。 – VonC
瞭解,謝謝。我會嘗試。 – H2ONaCl