I previously use Sourcetree to ignore the file index.jsx by accidentally. So right now, each time I created a index.jsx in different folder/path, it will be ignored automatically, unless I git add manually in IDE. So is there anyway that I can git add back index.jsx?
Asked
Active
Viewed 34 times
0
-
Are you asking about git or a particular IDE? If git, have you tried removing it from `.gitignore`? – Brian61354270 Jul 12 '23 at 19:07
-
I am not familiar with Sourcetree. There should be a `.gitignore` file in the project. It's a plain-text file. You can remove the entry for index.jsx from that file (and commit it). – SiKing Jul 12 '23 at 19:07
-
I have checked .gitignore file in IDE, but index.jsx file was not in there. – Shen Henry Jul 12 '23 at 19:13
-
2To debug a git ignore issue: run `git check-ignore -v
`. If a file is ignored, you will see a detailed list of the rules that target this file, and where the gitignore file is located. – LeGEC Jul 12 '23 at 20:45 -
Does this answer your question? [Git command to show which specific files are ignored by .gitignore](https://stackoverflow.com/questions/466764/git-command-to-show-which-specific-files-are-ignored-by-gitignore) – SiKing Jul 14 '23 at 14:02
1 Answers
0
thanks for the answers. just found out how to solve this situation;
I used the MacOS, SourceTree, RunbyMine at same time. When you ignore a file in SourceTree, SourceTree usually will put this file's name and extension(like index.jsx) into the .gitignore_global. You can go to setting -> git ->Global ignore List -> edit file to remove it.

Shen Henry
- 23
- 4