News for hackers. Stuff that matters.
Re:Where are my Git UI features from the future? by alex_suzuki on Sunday January 08, 2023 @02:05PM (#34302000)
What I like about SourceTree is the ability to pick individual lines and „hunks“ to stage, as I often have changes and some debugging stuff sprinkled into some files (think printf). Since it‘s not explicitly mentioned, I assume this is a pretty standard feature? I wouldn’t mind switching away from SourceTree, it crashes often.
Re:Where are my Git UI features from the future? by Lex-2008 on Sunday January 08, 2023 @02:23PM (#34302173)
I used `git gui` for that (not sure how "native" to git is it, though), and recently switched to `gitg` for both looking at tree and committing individual lines. Can't compare them with SourceTree, though, since haven't used that.

Also, when on command-line, I recently discovered `git add -i` for interactive mode (asks you about individual hunks and lets you "split" them), and `git add -e` (lets you edit the patch however you want).

Re:Where are my Git UI features from the future? by eyegor on Sunday January 08, 2023 @02:17PM (#34302106)
The one built into vs2022 has this and works pretty well if you happen to use it already. I think vscode has many of these features but I haven't tried it there. Otherwise I'd say look at gitkraken (free for personal use I think) or sublime merge if you really want performance.

Personally I use sublime merge or command line for everything. The sublime merge/text interactions are really nice, being able to right click in a diff and have it open the file at the line. You can try them for free forever but the price may be a deterrent since the dark theme for merge is locked behind a license key.

Re:Where are my Git UI features from the future? by iza on Sunday January 08, 2023 @02:17PM (#34302115)
Indeed most git GUIs can do this. git-gui (built-in), VSCode, Sublime Merge, Git Extensions to name a few.
Re:Where are my Git UI features from the future? by misnome on Sunday January 08, 2023 @02:17PM (#34302116)
You can do this on the terminal with `git add -p` but yes it’s always slightly more intuitive with a proper editor (I mainly use the many-times-forked GitX for this)
Re:Where are my Git UI features from the future? by rogerthis on Sunday January 08, 2023 @02:28PM (#34302223)
git add -p

or by right clicking in the diff pane in git-gui (which is almost never mentioned).

Although I use the cli more, gitk and git-gui solve all my GUI needs.

Re:Where are my Git UI features from the future? by okl on Sunday January 08, 2023 @02:17PM (#34302104)
Give `tig` a try.
Re:Where are my Git UI features from the future? by xtian on Sunday January 08, 2023 @02:16PM (#34302094)
Yes: `git add --patch`
Re:Where are my Git UI features from the future? by goku12 on Sunday January 08, 2023 @03:13PM (#34302598)
It's possible with various tools:

1. git add -i or -p 2. History edits using interactive rebases 3. Using tools like lazygit or git-ui 4. Using stacked patch tools like stgit or topgit 4. Here is my favourites: Use magit on emacs or fugitive on vim

The last one on magit and fugitive feels like interactive addition is closer to editing 2 files.

Re:Where are my Git UI features from the future? by brunobrito on Tuesday January 10, 2023 @10:26AM (#34326233)
You can also do this with Tower — here's an example: https://imgur.com/a/fVPZJL1

I work at Tower and I recently put together a "Tower versus Sourcetree" comparison page (there are many features that Sourcetree is missing): https://www.git-tower.com/compare/sourcetree/

I hope you give Tower a try! :)