How to read git index
file and extract all paths to text file?
except
git ls-files > out.txt
I mean using other things like regex or something else?
To see the content of the index file, use the command git ls-files
.
Assuming you're on either Windows, Linux, or Mac, you can reroute the command's output into a text file by using git ls-files > out.txt
.
git ls-files
command does exactly that. What exactly speaks against using the git command?git ls-files > out.txt
should do exactly what you want - it reads the contents of the index file in the current git branch and saves them into a text file, in this caseout.txt
. Have you tried using that command, and if so, can you explain how the command's output differs from what you're trying to obtain?git ls-files
- I just tried it myself.