How to avoid specifying absolute file path while git-add

Vaman Kulkarni picture Vaman Kulkarni · Jun 6, 2011 · Viewed 19k times · Source

Using git add command becomes tedious once the file path becomes lengthy. For e.g. git add src_test/com/abc/product/server/datasource/manager/aats/DSManger.java
Is it possible to bypass specifying absolute file path? May be using some kind of pattern or something?

I know that we can use git gui. But I want to do it using cmd line.

Thanks in advance for the inputs.

Answer

Steffen picture Steffen · Jun 6, 2011

For unix-like systems you can always use the star to point to files, e.g.

 git add *DSManager.java

will include all DSManager.java files git can find within your source tree starting in your current working directory.