News for hackers. Stuff that matters.
Re:The Missing Semester of Your CS Education by skydhash on Tuesday February 24, 2026 @10:53AM (#47138658)
Git is a cli software. If you find yourself repeating a set of commands, what you should do is abstract it using an alias or a script. And you will have you own nice interface.
Re:The Missing Semester of Your CS Education by esafak on Tuesday February 24, 2026 @01:04PM (#47140371)
That's a cop out. Not every CLI sucks so bad it needs a wrapper.
Re:The Missing Semester of Your CS Education by eigencoder on Tuesday February 24, 2026 @06:04PM (#47144697)
No it's not -- powerful CLIs with lots of features are made to be wrapped
Re:The Missing Semester of Your CS Education by janalsncm on Tuesday February 24, 2026 @06:39PM (#47145141)
Even as a CLI it’s not great. git checkout is extremely overloaded.
Re:The Missing Semester of Your CS Education by skydhash on Tuesday February 24, 2026 @11:24PM (#47147341)
Not really. The basic entity of git is the commit and git checkout is meant to restore the working tree to the state when the commit has been created. It may act on the whole tree, a specific part and if no commit has been specified, it uses the index as the source. And with branches being just pointers to commits, it's quite easy to see where the range of options comes from.

Git has its model for version control and it's something that most tutorials don't explain. The CLI is giving you maximum control over this model. For daily operations, it's quite easy to wrap it in a much amenable interface.

Re:The Missing Semester of Your CS Education by everybodyknows on Tuesday February 24, 2026 @02:53PM (#47141954)
My git experience got a lot better after I built scripts and customized the git config files to fully exploit:

  git-log --graph --reflog

  git-commit --amend

  git-cherry-pick
Also, becoming fluent with creation of and switching between local, short-lived branches.

With the above in order, I found I could subset the git state model:

* temporary branches rather than the "stash"

* commit tentative work to HEAD; amend, discard or set aside in a temporary branches rather than as later discoveries require

* side-step the index/cache/staging_area for most operations -- transfer directly between work tree and HEAD commit