Git add all .tex files recursively
Cloning a completely fresh repo.
I now have a complex file structure with many different files copied to my local working directory. But now I just want to add only all .tex files to all subfolders. But the following doesn't work:
git add *.tex git add /*tex #error-message: fatal: C:/Program Files (x86)/Git/*.tex: 'C:/Program Files(x86)/Git/*.tex' is outside repository
Working with git version 220.127.116.11.msysgit.0 on a Windows machine.
How to do it?
git add **/*.tex
Another approach: How can the .gitignore file be adjusted so that it ignores everything except .tex files? I tried the following in my .gitignore file and then did
git add .
, but it didn't work.
#Ignore all files * #except !**/*.tex
Got working with the following .gitignore file:
#Ignore all files * #except !*/ !.gitignore !*.tex
source to share