I'm trying to add artisan file from laravel installation in .gitignore. Not working. It is possible that GIT to mistake artisan [file] with a directory? There is no extension on artisan file and this can be a problem.
-
Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – 1615903 Dec 25 '18 at 08:56
2 Answers
I really can't find a reason for not adding the artisan bash script to the repository, but here is a tip on how to ignore it:
Your .gitignore is working, but it still tracks the files because they were already in the index.
To stop this you have to do : git rm --cached artisan
So in your .gitignore
add: artisan
in a new line
When you commit the artisan file will be removed from your git repository and the following commits will ignore the artisan file.

- 13,938
- 12
- 60
- 110
This question qualifies as a duplicate and would get merged.
I have had the trouble with gitignore too many times, I would suggest you to follow the following steps :
Make sure whether this is your first commit or earlier these files were added and thus have become cached.
- If yes, then git rm -r --cached . and git add . (do not miss the dot)
If it still isn't working, open file menu in notepad
Go to File -> Save as
Change the encoding to ANSI. (Some answers mistakenly say UTF-8 , but it doesn't work and wastes time needlessly)
- Again git rm -r --cached . and git add . (do not miss the dot)

- 922
- 1
- 11
- 21