I am fairly new to git but have a beginners grasp of it at least. While working on my project I decided to upload all of my current files to a private repo. For some reason when I initialized my folder it started behaving in a way I haven't seen before at least. It seems to be tracking files inside of my .venv, which then leads to approximately 5000 or more changes that need to be committed. You can see in my attached screen shots that the pink 5k. Because of this it doesn't actually track changes in my project itself. What did I do wrong? The only thing I can think of is I did initialize when my venv was already activated, maybe I should have done it before that? I am not sure how to solve my issue so any help is greatly appreciated!

- 233
- 3
- 17
1 Answers
I think what you are missing is a .gitignore
file that contains ".venv". Naturally when you add all files in your directory to git (e.g. via git add -a
) it adds also hidden folders like the .venv one. If this wasn't the case in other projects you worked on I assume that they had a fitting .gitignore
file or if it was on another machine there might have been a global gitignore in place (see https://stackoverflow.com/a/7335487/1967127).
Long story short if you create a file called .gitignore
in the root directory of your project and add the line:
.venv
...then git should ignore that folder from then on.
If you already added and commited the folder in an earlier commit please refer to https://stackoverflow.com/a/30360954/1967127 on how to remove it from the git index.

- 737
- 12
- 24
-
1Yes thank you funnily enough I just did this exact solution based on more googling. Thank you for the help! – mharre Jul 16 '21 at 11:31