Add all untracked files to index in Git fully automatically

The suggested way of adding all untracked files to the index in Git is to use the interactive add command:

This can be fully automated as follows:

The commands entered via standard input (a,*,q) will not be printed. For convenience, we can also define an alias in ~/.gitconfig:

References

  • [1] Mat’s and EAGER_STUDENT’s answer on StackOverflow

 

Leave a Reply