git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
linuxfish
V2EX  ›  git

请教:git不能add、commit子文件夹?

  •  
  •   linuxfish · May 19, 2013 · 21333 views
    This topic created in 4926 days ago, the information mentioned may be changed or developed.
    比如我的主文件夹是test,下面有t1 t2 t3这三个文件夹,t2下面还有几个子文件夹,当我在test目录执行git init git add --all后只添加了t1 t2 t3这几个文件夹的信息,有人知道是怎么回事吗?谢谢啦!
    10 replies  •  1970-01-01 08:00:00 +08:00
    vietor
    vietor
    May 19, 2013
    1
    没有使用.gitignore的规则吧?
    ShadowStar
    ShadowStar
    May 19, 2013
    2
    空目录无法add。
    如果想add一个空目录,在它下面touch一个.gitignore文件吧。
    linuxfish
    linuxfish
    OP
    May 19, 2013
    3
    不是空目录,里面有文件的,只是有多级目录
    sugarit
    sugarit
    May 19, 2013
    4
    一般都是放一个.gitkeep文件
    linuxfish
    linuxfish
    OP
    May 19, 2013
    5
    解决了。。
    删除.git后重新git init解决
    duhastmich
    duhastmich
    May 19, 2013
    6
    这不科学
    detailyang
    detailyang
    May 19, 2013
    7
    我猜是因为子文件夹本身也有.git吧 = =
    TankyWoo
    TankyWoo
    May 19, 2013
    8
    2L是正解!
    TankyWoo
    TankyWoo
    May 19, 2013
    9
    @detailyang

    git子文件夹是不会有.git的,但是svn的有
    linuxfish
    linuxfish
    OP
    May 19, 2013
    10
    @detailyang 你猜对了,但原因未知,我曾经删除后再重新git add .依然没解决问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4823 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 02:35 · PVG 10:35 · LAX 18:35 · JFK 21:35
    ♥ Do have faith in what you're doing.