The anatomy of Git – A beginner-friendly explanation of how Git works
Git is incredibly powerful, especially as projects become more complex. Up until now, our focus was on a straightforward history. However, where Git really shines is in its ability to handle large projects with a large number of contributors and manage the dynamically evolving code within a team seamlessly. We have come this far intuitively, working with Git operations as commands work. It is time to get down to the nitty-gritty. While it is helpful to have an intuitive feel for Git, by understanding how Git operates behind the scenes, we can harness its full potential.
The file lifecycle in Git
In Git, we learned in the previous section that saving changes is a two-step action, staging and committing, but Git actually handles files in four states.
Every file in your project can be in one of four states:
- Untracked: Files that are present in your directory but have not been added to Git’...