3 ms·
Git confuses me - a lot. Like, what's the point of staging? You write: > Why have a dedicated staging area? > So that you can choose and review which files an
by eesmith 7y ago
Git confuses me - a lot. Like, what's the point of staging? You write:
> Why have a dedicated staging area?
> So that you can choose and review which files and changes to commit before committing.
Mercurial doesn't have a dedicated staging area, and I don't think I'm missing anything important by not having it, so this explanation doesn't seem to add anything.
But, looking now I see there are a number of resources along the lines of "git for Mercurial users", so perhaps think of me as not your target audience.
- chrisa 7y agoYeah, I'm not familiar enough with Mercurial to really say how they are similar or different, so I'm not much help there. Sorry! I can still try to answer the staging question though: So - once you create a commit, it's in the repo forever, so with staging, you can gradually build up a commit without doing it all at once (adding one file at a time, over time for example). You can also stage just part of a file (just a few changes), and create only the commit that you really want to go into the repo. I suppose it's kind of like a "commit preview" that you build over time. In practice, a lot of people do just add all their changes and then commit immediately though - so yeah, in that case a staging area doesn't make any difference :)