from Hacker News

Highlights from Git 2.23

by digitalnalogika on 8/16/19, 9:57 PM with 24 comments

  • by mhd on 8/17/19, 9:40 AM

    I really need some kind of "modern git" tutorial. A lot of what we're doing day to day stems from the earlier days of the software (and SO posts from that time), and I bet there's plenty of new options that would make something easier or even enable different workflows. I just recently learned about "git worktree", for example.
  • by nemetroid on 8/16/19, 11:26 PM

    I'm wary about git restore --staged. It seems backwards to have a destructive (worktree-modifying) command become non-destructive by adding a flag. To me, this appears more footgun-prone than git reset, which defaults to non-destructive behaviour and requires the ominous --hard flag in order to become destructive.

    So I will probably avoid both git restore --staged and git reset --hard (and suggest to others to do the same). I hope git status will keep the hint to use git reset to unstage, even after git-restore becomes stable.

  • by kissgyorgy on 8/17/19, 7:18 AM

    This is still far from ideal. "git switch" and "git checkout" should not be able to create a new branch. It clearly should be the "git branch" subcommand's responsibility, because "You want to do something with a branch". It would be two commands to create and checkout a new branch, but less confusion. You can use your git alias anyway. But a shortcut for "git branch -c" would be better if you want to keep the "create and switch" shortcut IMO.
  • by saagarjha on 8/16/19, 11:27 PM

    It's nice to hear that there appears to be progress being made in making git's tooling nicer and more consistent. Git's model itself is pretty simple, but the command line tools for working with it aren't and I feel that this fuels most of the "Git is hard" complaints.
  • by tomasyany on 8/17/19, 2:43 AM

    On the one hand I'm happy on the new "switch" and "restore" commands. On the other hand I wonder if they truly add any value other than the semantic distinction of functions otherwise present in "checkout".

    I tend to prefer smaller vocabularies tools: less to remember if you know what you are doing.

  • by Ayesh on 8/18/19, 1:43 AM

    Similar to GUI apps that work on top of git binary, does anyone know a user friendlier CLI app?

    It can have new commands:

    - `gitlite create` vs `git init`

    - `gitlite branch create feature-dom` vs `git checkout -b feature-dom`

    - `gitlite time-travel cfae736` vs `git checkout cfae736`.

    - `gitlite undo cfae736` vs `git reset cfae736 --hard`

    - gitlite release create v4.2` vs `git tag v4.2`.

    Each command will call the translated `git` command, and perhaps improve upon the output from the command.