Just pulled a branch which another developer was working on it. I haven't changed anything at all. Just pulled and run git status and git shows that ../.eslintcache is untracked and is suggesting to include it in what will be committed.
What should I do? I don't think that I should add and commit it.
git pull doesn't delete uncommitted changes, it doesn't deal with your working directory, any changes or new files will not be touched unless it committed.
git reset --hard resets your index and reverts the tracked files back to state as they are in HEAD. It leaves untracked files alone.
Add folders and files you don't want to have in your repo to .gitignore
Here is more info about that file: https://git-scm.com/docs/gitignore
For instance files generated by IDEs and tools used while development are usually added there. Like .eslintcache folder added by eslint. This might happen because you added this folder to your IDE, which probably runs linting and other check ups running in the background.
In your case .gitignore might look like:
.eslintcache
#JetBrains IDE
.idea/
It's a leftover of you previous work.
Either you made linting, ot is is a part of some other job/script. In .eslintcache some linters caching occurs, and during this process it was created.
When you checking out new branch all untracked files will be still reside in you directory, unless there will be some conflicts.
You should add generated files (like .eslintcache) which you don't want to appear in git status
, to be omited by git to .gitignore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With