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

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

  •  
  •   linuxfish · May 19, 2013 · 20904 views
    This topic created in 4747 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
        1
    vietor  
       May 19, 2013
    没有使用.gitignore的规则吧?
    ShadowStar
        2
    ShadowStar  
       May 19, 2013
    空目录无法add。
    如果想add一个空目录,在它下面touch一个.gitignore文件吧。
    linuxfish
        3
    linuxfish  
    OP
       May 19, 2013
    不是空目录,里面有文件的,只是有多级目录
    sugarit
        4
    sugarit  
       May 19, 2013
    一般都是放一个.gitkeep文件
    linuxfish
        5
    linuxfish  
    OP
       May 19, 2013
    解决了。。
    删除.git后重新git init解决
    duhastmich
        6
    duhastmich  
       May 19, 2013
    这不科学
    detailyang
        7
    detailyang  
       May 19, 2013
    我猜是因为子文件夹本身也有.git吧 = =
    TankyWoo
        8
    TankyWoo  
       May 19, 2013
    2L是正解!
    TankyWoo
        9
    TankyWoo  
       May 19, 2013
    @detailyang

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