1

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?

Mureinik
  • 297,002
  • 52
  • 306
  • 350
LondonRob
  • 73,083
  • 37
  • 144
  • 201

1 Answers1

3

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

$ git add foo/**/some_file.txt
Mureinik
  • 297,002
  • 52
  • 306
  • 350