Why does the Version Control System Git stage files first, instead of committing them directly? I mean why we can't just commit files directly instead of staging them firstly then commit them?
Asked
Active
Viewed 58 times
1 Answers
0
Instead of committing all of the changes you've made since the last commit, the stage lets you group related changes into highly focused snapshots before actually committing it to the project history. This means you can make all sorts of edits to unrelated files, then go back and split them up into logical commits by adding related changes to the stage and commit them piece-by-piece. As in any revision control system, it’s important to create atomic commits so that it’s easy to track down bugs and revert changes with minimal impact on the rest of the project.
Ref : https://www.atlassian.com/git/tutorials/saving-changes

Yogita Kumar
- 262
- 2
- 7