如題,我本地有一個_posts資料夾,但是我做了一些修改後再push到github上卻看不到這個資料夾了,請問這是怎麼回事,該如何修復呢?
git status
的輸出如下:On branch gh-pages
Your branch is up-to-date with 'origin/gh-pages'.
nothing to commit, working directory clean
然後操作
git add _posts
git status
輸出:
On branch gh-pages
Your branch is up-to-date with 'origin/gh-pages'.nothing to commit, working directory clean
git commit -a
的輸出
On branch gh-pages
Your branch is up-to-date with 'origin/gh-pages'.
nothing to commit, working directory clean
執行git rm -r _posts
後有以下輸出:
fatal: pathspec '_posts' did not match any files
滿天的星座2017-04-28 09:06:39
你那上面的輸出資訊一直再說工作目錄是乾淨的,沒什麼好commit
的。要么是你目录下没有文件,要么是你已经执行过一次commit
,之後沒有再修改或添加過文件。你可以:
_posts
下创建一个文件touch _posts/README.md
git add _posts
git commit -m '创建_posts/README.md文件