Your file .gitignore
is working as you wish in the repository root directory. However, if the desired files are inside sub-folders, you should add these sub-folders also in a denial of the .gitignore
.
Try the following:
*
!*/
!*.c
Which gives the following result:
$ ls pastanova/
abacate.c abacate.exe* b.c b.exe*
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: a.c
new file: pastanova/b.c
Untracked files:
(use "git add <file>..." to include in what will be committed)
pastanova/abacate.c
That is the desired result. For more information see this question (in English).
Note: Your last line *.exe
was redundant.
did not understand your question. Please explain better. This is happening when uploading files to a remote Git repository?
( git push )
– Deividson Damasio