Overwriting folders with git
I’m learning how to use django on a EC2 server, but i am editing the code on my local computer. When i run things like :
python manage.py startapp polls
It creates a folder with various files inside. Instead of individually adding the files to git, which leaves the possibility of me forgetting to add every newly created file, is it good practice just to:
git add (the root django project directory)
everytime django creates new files?
If this isn’t good practice, what methods do you guys use to ensure that all files get added to git everytime new files are created?
2 Solutions collect form web for “Overwriting folders with git”
I think you’re over-thinking this. Ignore files you think you should (like *.pyc). Add all the files or do them individually, whichever you prefer. If you accidentally added one you shouldn’t have, do a checkout of that file so that you don’t add it. If you already committed with a file, git delete the file and commit.
git status, it will give you the list of all the files it’s currently not tracking, so you can use that as a reference if you’re afraid you’ll forget something.
Additionally, I would say that you don’t want to forget to properly setup your .gitignore, and then you can instruct git to add everything, otherwise, like Mark suggested, you would potentially be adding **.pyc* files, which you don’t want to do.