0

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.

Militaru
  • 521
  • 5
  • 11
  • 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 Answers2

2

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.

nakov
  • 13,938
  • 12
  • 60
  • 110
0

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 :


  1. Make sure whether this is your first commit or earlier these files were added and thus have become cached.

    1. If yes, then git rm -r --cached . and git add . (do not miss the dot)
  2. If it still isn't working, open file menu in notepad

  3. Go to File -> Save as

  4. Change the encoding to ANSI. (Some answers mistakenly say UTF-8 , but it doesn't work and wastes time needlessly)

    1. Again git rm -r --cached . and git add . (do not miss the dot)
user3251882
  • 922
  • 1
  • 11
  • 21