End Goal:
Have git recursively ignore files of type *.abc
Problem: Git
Description:
I have the following line in my gitignore
top level file located at /home/alma/project-origin/.gitignore
.
/**/*.abc
I issue the following commands and get the following output
cd /home/alma/project-origin/top-secret/subject
touch alma-wade.abc
git status .
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
alma-wade.abc
nothing added to commit but untracked files present (use "git add" to track)
to trouble shoot I create a .gitignore
file in that folder and run it again
cd /home/alma/project-origin/top-secret/subject
touch alma-wade.abc
echo "*.abc" >> .gitignore
git status .
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
modified: .gitignore
nothing added to commit but untracked files present (use "git add" to track)
I removed the .gitignore local file (rm /home/alma/project-origin/top-secret/subject/.gitignore
) and started trouble shooting
(A) Removing from cached
cd /home/alma/project-origin/top-secret/subject
git rm -r --cached .
git commit -m "..."
git push origin master
#Successful push
git add .
git status .
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
alma-wade.abc
nothing added to commit but untracked files present (use "git add" to track)
(B) Checking file encoding
file -bi /home/alma/project-origin/.gitignore
text/plain; charset=us-ascii
(C) Checking for trailing spaces
opened /home/alma/project-origin/.gitignore
in vim and issued the command :set list
and conducted a visual inspection
(D) Using git check-ignore -v
git check-ignore -v --no-index /home/alma/project-origin/top-secret/subject/alma-wade.abc
#no output
echo "*.abc" >> .gitignore
git check-ignore -v --no-index /home/alma/project-origin/top-secret/subject/alma-wade.abc
/home/alma/project-origin/top-secret/subject/.gitignore:1:*.abc /home/alma/project-origin/top-secret/subject/alma-wade.abc
rm .gitignore
(E) Using git check-ignore -v from top level directory
This is the closest I have come to resolving this issue
cd /home/alma/project-origin/
echo "/**/*.abc" >> .gitignore
cd /home/alma/project-origin/top-secret/subject/
git check-ignore -v --no-index /home/alma/project-origin/top-secret/subject/alma-wade.abc
#No output
cd /home/alma/project-origin/
git check-ignore -v --no-index /home/alma/project-origin/top-secret/subject/alma-wade.abc
/home/alma/project-origin.gitignore:1:/**/*.abc /home/alma/project-origin/top-secret/subject/alma-wade.abc
The top level .gitignore
rule is applied when I do the check from the top level folder, but not when I am in a sub folder. I am at my wits end. The only thing I can think of is that this has something to do with the file system (cifs mounted). Could someone please help.