Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add all not tracked files at once

Tags:

mercurial

$ 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'.

like image 363
ceth Avatar asked Oct 31 '10 18:10

ceth


People also ask

How do I add all untracked files?

The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area. We also say that they will be staged.

How do I push untracked files?

You have to add the untracked files of the repository by using the “git add” command and run the “git stash” command to save the untracked file and clean the current directory for working by removing the untracked file from the repository folder.

Does git add * Add untracked files?

So, if you run git add . within a sub directory, it won't add changes to files outside that sub directory. Second, git add . adds both tracked and untracked files.

What happens to untracked files?

Most untracked files will be staged and committed. Others will simply be ignored by including them in the . gitignore file. However, some files and directories will remain untracked, and in certain instances it can be useful to delete these untracked files from your Git repo.


Video Answer


1 Answers

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.

like image 95
Peer Stritzinger Avatar answered Oct 11 '22 05:10

Peer Stritzinger