All the ways to `git add`

I always get confused with, should I run git add ., or should I run git add --all, or should I run git add -A? Given all these commands, do a similar thing, confusion is bound to happen. Thankfully, it’s not just me. So I decided to take a deep dive into add command of git, to end this confusion once and for all. What does add even do? The add command adds your changes to staging area. Staging area is a buffer zone where you place your files before committing them. This buffer zone allows you to be selective with your commits, there are some files that you want to commit now and some files that you want to commit later. Staging area is also known as index. ...

October 24, 2024 · 3 min · 560 words · Mohit Sharma