search

Home  >  Q&A  >  body text

git:本地有的文件夹push到github上之后却看不到

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

reply all(4)I'll reply

  • 怪我咯

    怪我咯2017-04-28 09:06:39

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

    reply
    0
  • 黄舟

    黄舟2017-04-28 09:06:39

    Have you git commit -a?不添加commit? It can’t be pushed up.

    reply
    0
  • 怪我咯

    怪我咯2017-04-28 09:06:39

    Is your working directory correct?

    reply
    0
  • 滿天的星座

    滿天的星座2017-04-28 09:06:39

    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文件
    6. reply
      0
  • Cancelreply