what problems do you run into with git's staging area? right now I'm feeling like the staging area is one of the least confusing parts of git (merging, branches, and remotes seem to cause people a lot more problems) but I'm very open to writing about it if there are problems

some of the problems folks have listed so far with the staging area:

1. there are (at least) 3 ways to diff and the default feels unintuitive (`git diff` vs `git diff --cached` vs `git diff HEAD`)
2. carefully staging changes with `git add -p` and then running `git commit -a` by accident is annoying
3. if you `git stash` with things in the staging area, staged changes are stashed too (can disable with --keep-index)

would love solutions to #2 if anyone has one

(2/?)

Follow

@b0rk A good practice that makes #2 less likely is "git config --global commit.verbose true" and reviewing the contents of every commit you make before writing the commit message. If you notice it has things you don't want, you can close the file without a commit message (or delete the commit message if there is one), and the commit will be aborted with your index left as it was.

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!