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:

  • can't git-push to heroku due to “Build stream timed out”
  • Recommended .gitignore file for Python projects?
  • Django Private Project Git Repo - Open Source App Repo
  • Should I add Django admin static files to my git repo?
  • Django error on makemessages “should be run from the Django Git tree or your project or app tree”
  • Can't find local files after pushing new git branch
  • 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?

  • Why doesn't git rebase -i :/^major work?
  • Git sync says ahead by 1 commit and behind by 4 commits
  • How to pull updates from parent Git repo after forking?
  • PS1 env variable does not work on mac
  • How to move a git note to a different commit?
  • git lfs ls-files : Asterisk (*) vs. Dash (-)
  • 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.

    You use 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.

    Git Baby is a git and github fan, let's start git clone.