git:本地有的文件夹push到github上之后却看不到
巴扎黑
巴扎黑 2017-04-28 09:04:39
0
4
1152

如题,我本地有一个_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
巴扎黑
巴扎黑

reply all (4)
刘奇

Github does not allow pushing empty folders by default, so if you just add an empty folder, it will not be pushed.

    黄舟

    Have yougit 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
        1. _posts下创建一个文件
          touch _posts/README.md
        2. Add to Git

        3. git add _posts
        4. Add operation information

        5. git commit -m '创建_posts/README.md文件
          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!