Or debugging code. You're right, git add -p is a lifesaver.
The idea to remove the concept of the staging area to simplify git is worthwhile. I heavily use `add -p` myself, but newbies certainly struggle with it and teaching `commit -a` is not the solution.
No, because I don't run `git add -p` before committing (I would run `git commit --patch` for that). I run `git add -p` during the development cycle. To emulate this with `git stash` would require a very annoying dance with stash and rebase.
> newbies certainly struggle with it
Newbies don't even know about `git add -p`. Newbies struggle with git because commands are not orthogonal (as the article mentions), and because documentation sucks. There is nothing inherently difficult about the staging area, it's just that it's not very visible what object a command would use or affect (index/tree/working directory) and it's hard to learn this.
The problem is with the implementation, not with the model.
Another problem is that in most cases people don't really want git, they want svn with local commits and better merging capabilities. Git is very popular, for some reason people use it even if it's clearly not what they want or need. To these people I suggest they should use the DVCS features of Perforce.
Not having a staging area (or using git add . && git commit -a to bypass it) has it's drawbacks too; I think most of the "garbage" files like "main.o" and ".test.py.swp", and secret API keys in public repos, can be explained that way.
To me, the answer is not abandoning the staging area, but improving the UI for handling it and/or directing users that don't want to deal with the git UI to things like GitUp. The git UI is horrible in a lot of places, admittedly. Even now, considering myself an advanced user, my workflow still is "git branch ... uhmmm... ^H^H... git checkout -b topic".
Fixing the (most annoying issues of the) UI might require some breaking changes sometimes, but so be it.
git stash -k
Which will create the stash with your changes (both staged and unstaged), but keep the staged ones in the staging area and in the working tree.https://github.com/git/git/blob/659889482ac63411daea38b2c3d1...
Anyone that wants to use TYOOL 2016 age DVCS features should also switch. Like changing history yet still keeping a record of the original one (hg evolve).
Git completely owned all other DVCS with good branching. 10 years ago. But now it's time to move on to better tools.
Some companies even have Git, Mercurial, and SVN, working all together under centralized repository management.
Both git and mercurial can talk to "non-native" remote servers.
IIRC mercurial can talk to subversion and git (with hg-git).
Git can talk to subversion, cvs, perforce, mercurial (there are multiple tools for the latter, and I'm the author of one of them), bzr, and maybe others.
If things don't work smoothly in any of those cross-VCS configurations, my belief is that issues should be filed and fixed.
Working in a big firm adds overhead, yet has certain benefits (resources, etc.). That's a whole different topic though.