Assessment – Git: A Better Kind of Backup

Oct 2, 2014 • Jonathan Gross

You just finished editing the file main.py (already tracked by git) and created a new file functions.py that you want git to track. What command(s) will save all these changes to the repository?

  1. > git commit -a
  2. > git add functions.py; git commit
  3. > git commit functions.py; git commit main.py
  4. > git add functions.py; git commit -a

You edit the files main.py and functions.py. After editing functions.py, you realize there is only one function left in it, so you rename it function.py. If you run “git status” after these changes, which file(s) will be in the “Changes to be committed”, which file(s) will be in the “Changes not staged for commit”, and which file(s) will be in the “Untracked files”?