Skip to content
Eevee edited this page Aug 2, 2014 · 1 revision

Things that feel unnecessarily hard, awkward, confusing, or cumbersome in git

Human-friendly questions or tasks are often hard to answer

  • What branch did this commit (probably) originally come from?
  • When/where was this commit merged into this branch? (Really need history view that's amenable to feature-branch workflow, which virtually everyone uses some variation of.)
  • Deleting merged feature branches, both here and on the remote
  • What can I safely rebase? What have I pushed? What tracking branches are out of date?
  • Cascading rebase
  • I did this work on the wrong branch, oops!
  • Deleting old stashes
  • Finding a change I know I made... somewhere...
  • Upstream is readonly and I want to push somewhere else by default

...programmatically

  • What branch am I on?
  • What files are changed?
  • What does the index look like? (git hooks especially)

Duplicated terminology

  • stage vs cache vs index

Overloaded commands

  • checkout: revert local modifications or switch branches or create a branch
  • reset: unstage a file or move the branch pointer or some wacky combination of both

Inconsistent command syntax

  • File versus ref is often ambiguous and requires a -- — or, worse, in some places you can have one or both
  • Branch names containing slashes get particularly fuzzy
  • git tag vs git remote -v vs git remote -a
  • git remote rm vs git branch -d
  • git pull origin master vs git merge origin/master argh!

Unexpected behavior

  • push and pull are not direct opposites
  • git pull origin doesn't update origin refs
  • revert does nothing like what most VCSes would call reverting

Could be more helpful

  • Have seen + experienced forgetting I'm in the middle of a merge/rebase on more than one occasion, which does very funny things
  • Nothing stops you from committing conflict markers to resolve a merge
  • Pulling tells you about deltas and unpackings and whatnot, and might even give you a diffstat, but doesn't tell you how many commits were pulled
  • I often just want to see "what is the state of my entire repo" but that isn't a thing
  • "Stash your changes!" instead of just doing it for me with a per-branch floating stash (though to be fair sometimes I want to check out a different branch with changed files)
  • git add with no args just prints an error

Particularly problematic git commands

  • git rebase
    • 'forward-port local commits blah blah blah'. it is too magical. split up this thing's many moods.
    • tcup squash rev..range; tcup stir up-to-rev (interactive rebase); tcup transplant... need i go on?
    • expand tcup amend to allow amending an arbitrary commit, so no need for "fixup!" silliness; lots of warnings of course
    • i can't change my mind on a rebase -i order partway through, after discovering that i put two commits in the wrong order, and have to start from scratch and recreate all my changes
      • for that matter, i wish i could see the reflog visually
    • wouldn't mind a visual representation of how the proposed stack together, either (detect how badly each might conflict?)
  • git revert
    • annoying because every other VCS means 'give me a pristine copy of this file', not 'reverse this commit'
    • git checkout means multiple things and this is none of them
  • git reset
    • this command apparently has erectile dysfunction - soft, mixed, hard??? it all makes sense if you read the manpage but the ultimate effects seem thoroughly unrelated

Steal from these