Hacker News new | ask | show | jobs
by LoveMortuus 1367 days ago
I'm by no means an expert, but is it really that hard to remember clone, pull, commit -a, push and maybe something else you'd need. That you need a GUI? And even then you can either use the help or man or just Google it and you'll remember the right command sooner than later.

Or am I missing some quite important? I've been using this for most of the stuff that I do in github and it seemed to be enough.

I use these on my Chromebook, but on my stationary computer I just use the integration in VS Code.

6 comments

> Or am I missing some quite important?

I feel like you are. The operations you mentioned - clone, pull, “commit -a”, and push - are trivial. Nobody needs a nice UI for those.

But in real day-to-day use, I’m branching, merging, creating and applying stashes, cherry picking, rebasing, browsing the repo history, browsing specific file histories, diffing across branches, selectively committing specific changes in a file, etc. and it’s convenient to have a nice UI for the more advanced use cases.

People who use commit -a terrify me. The value of a tool like this is it makes it trivial to review changes, stashes, etc. in a convenient way without needing to look up commands. This tool in particular is built to handle huge repos which most other front ends straight up can't. And it does it with a 1mb binary and almost no ram.
Definitely agreed. My workflow for a commit is always:

    git status
    git diff HEAD
    git add (usually -u)
    git commit
I catch so many mistakes checking the diff before committing. Just seeing the code in a different context helps things pop up.
git add -p is my default. Usually what I have been up to belongs in 2-3 separate commits, each with a good commit message. For example a bug found and fixed while developing a feature always goes in its own commit.
> Or am I missing some quite important?

Speaking as to "why would you not just use command line git, or VSCode integration".

Two aspects: Speed, and discoverability.

These are two things that magit massively improves upon the command line.

e.g. to make the commit, in magit, it's the key sequence "<Spc> g g" (to open magit) then "c c" to commit. (Being able to quickly do this from the same place you edit code is very convenient).

In terms of discoverability, magit shows me the common options for commands (e.g. it shows `-a autostash` for git pull), or other commands which might be useful that I've not used (like git worktree).

I use a git GUI (Sourcetree) as a time saving tool to visualize the git repo, browse through commits to view changes, diff non adjacent commits or branches, etc. I have never used it to actually alter the state of my repo, all that is much easier on the command line for me. But TUI is woefully inadequate for getting the hang of even a moderately complex repo that I'm trying to understand.
I use an alias like this:

> gac Update controller

which means “git add all and commit with this message” very rarely do I make a mistake with this. Maybe once every 3 weeks, in which case I just restore the file I accidentally added.

no but it (at least tig) facilitates navigating the graph, partially staging etc.