Commits
A commit is a save of your project. It snapshots the entire working directory. Commits are made explicitly by the user.
Instead of storing all files, Git records a commit as a change set. A change can be deleting a line, or add a line after another. These change sets can be saved and re-applied if needed.
A commit doesn't limit on the number of changes involved. You can edit hundreds of files and make that as a commit. However, it's wise to put relevant changes in a commit, so that you can revert to a previous state in a more atomic manner.
For example, when you develop an neural network model, it's rational to group the code for model itself as a commit (or even smaller commits), then fine tuning as another. That way if you want to redo the fine tuning you can just revert the fine tuning step. If you make both steps as one large commit, you won't be able to jump back to the state in between.
In short, commits should be atomic.
Last updated