I want to add a file named Credentials to .gitignore, so here's how I did, I added the following line to .gitignore file which is in app directory:
/src/main/java/my/package/name/utils/Credentials.java
But it still shows up in git status.
I want to add a file named Credentials to .gitignore, so here's how I did, I added the following line to .gitignore file which is in app directory:
/src/main/java/my/package/name/utils/Credentials.java
But it still shows up in git status.
Quoting man gitignore
:
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected
If the file that you're looking to have ignored by git is already a file being tracked, you'll have to git rm --cached
it first.
For more info: https://git-scm.com/docs/gitignore