V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
icemanpro
V2EX  ›  git

增加已 ignore 目录下某目录的跟踪,gitignore 文件内应该怎样写?

  •  
  •   icemanpro · Aug 11, 2014 · 3078 views
    This topic created in 4287 days ago, the information mentioned may be changed or developed.
    /Root
    |__A
    |__B
    |__b1
    |__b2
    |__....
    |__bn

    想只跟踪/root/B/b2这个目录, /root/B内其它文件及目录都不跟踪,gitignore应该如何写?

    现gitignore内容如下
    /Root/B

    !/Root/B/b2

    以上写法,B目录已ignore,但b2目录也ignore.
    2 replies    2014-08-11 14:06:45 +08:00
    nicai000
        1
    nicai000  
       Aug 11, 2014
    git help ignore为什么不看? 例子里最后一个就是
    yueyoum
        2
    yueyoum  
       Aug 11, 2014
    在 /root/B 目录下 建立一个 .gitignore
    内容如下:

    /*
    !/b2

    然后 git add /root/B
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   922 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.