Add all not tracked files at once

27,272

Just use hg add with no *.

When no files are given, it adds all untracked files, that is, all files with ? in front of the output of hg status.

Files that are ignored because of .hgignore will not be added by hg add without filenames.

Share:
27,272
ceth
Author by

ceth

I'm a programmer, occasional SRE, Unix automator. I'm currently working primarily in Go, and prior to that my weapon of choice was Python, but I'm also familiar with Java, C#, JavaScript, and bash. I dabble in Clojure and F# but I've never thrown a big problem at it. I run Linux at home and at work but that doesn't mean I'm ignorant of other systems :)

Updated on February 16, 2020

Comments

  • ceth
    ceth over 4 years
    $ hg status
    
    M ...
    M ...
    M ...
    ? ...
    ? ...
    ? ...
    

    I need to add all not tracked (? marked) files. Is it possible? I can do "hg add *" but I will get many messages unwanted 'file already tracked'.