When I want to git add a file, it's often in a subdirectory.

Imagine I have this set of changed files and I want to git add some_file.txt:

foo/bar/some_file.txt
foo/bar/other_file.txt
foo/baz/third_file.txt

I've seen somewhere that there is a way to say:

git add foo/{any intermediate directory}/some_file.txt

I thought it involved foo/../some_file.txt but it can't be that because that means "parent directory"

What was it?

1 Answers

2
Mureinik On Best Solutions

You can use ** to specify "any directory":

$ git add foo/**/some_file.txt