如题,我本地有一个_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
Github does not allow pushing empty folders by default, so if you just add an empty folder, it will not be pushed.
Have you
git commit -a
?不添加commit
? It can’t be pushed up.Is your working directory correct?
Your output message above keeps saying that the working directory is clean and there is nothing to worry about. No files have been modified or added since then. You can:
commit
的。要么是你目录下没有文件,要么是你已经执行过一次commit
at
Add to Git
Add operation information
_posts
下创建一个文件touch _posts/README.md
git add _posts
git commit -m '创建_posts/README.md文件