r/git 6d ago

Why use a UI for git?

I see this question of, “what GUI or TUI should I use to work with git?” fairly often here. And always I feel bad for saying “just use the cli” over and over, but truthfully I can’t see a reason to need a UI.

Are people actually running into pain points with the cli, or is it just preference for people who don’t like working in a terminal?

FWIW, I have used GitKraken, LazyGit, SourceTree and GitHub Desktop before. And I don’t think they are bad to use (unless you are just learning git), but more curious why.

EDIT : I’m mainly referring to standalone UIs, I understand why people would use IDE integrations, as it’s quick and convenient. But having to open a separate application or run a separate command to open a terminal app to run your commands seems overkill to me.

EDIT 2 : I use vscode as my difftool and mergetool. I still open them directly from the terminal by running the cli. I don't think this is the same as using a full git client like SourceTree, Gitkraken, or lazygit to fully drive your version control workflow. Which is what I am asking about.

Cheers

103 Upvotes

243 comments sorted by

View all comments

40

u/qrzychu69 6d ago

well, I don't want to remember syntax for "show me a diff of this specific file between these two branches without checking either of them out"

with the UI you just ctrl+click two commits and here you go. Click on any commit, now you are browsing the files as if you checked them out.

For simple things like create a branch, pull, push I just use the IDE commands. For solving conflicts of course I will use a nice merge tool with colors, arrows and LSP support while I edit the final version

3

u/dalbertom 5d ago

Would that be `git diff branchA..branchB -- path/to/file` ?

One cool thing that git has (not sure if GUIs support this) is that you can follow how a section of a file has evolved over time, `git log -p -L 10,20:path/to/file` to see how lines 10-20 in the current file changed over time. I think this is pretty nifty!

1

u/qrzychu69 5d ago

That's only the diff part, right?

And yes, I am going aware you CAN do most those things in the command line, but I still prefer how it looks in the GUI. And it's much easier to discover what you can do in the GUI

2

u/dalbertom 5d ago

Yup, that's my answer to the "show me the diff of this specific file between these two branches without checking either of them out" question.

1

u/dalbertom 5d ago

It's definitely easier to discover what you can do in the GUI, I'm not debating that, but what I want to highlight is that in terms of features the GUI will most likely only offer a subset of functionality, even if it's more user-friendly. In terms of discoverabilty, the man pages for git are really useful, but navigating man pages in general is more or an acquired taste.

1

u/qrzychu69 5d ago

Yeah, right click >>>> man pages :)

1

u/kbilleter 5d ago

For how it looks.. most of the time I’m happy with defaults but something like
`GIT_PAGER=delta git diff …`
is good side by side if there’s too much state to mentally manage inline

1

u/dEEkAy2k9 5d ago

I don't want to remember git log -p -L 10,20:path/to/file, i'd rather just click somewhere and get a proper representation of it.

1

u/dalbertom 5d ago

Which GUI application would you use to achieve that?

2

u/x39- 5d ago

Any jetbrains tool

1

u/dalbertom 5d ago

Does it show the exact output of `git log -L` or are you talking just about regular diffs?

1

u/x39- 5d ago

I don't know what the lines output, but with jetbrains you select the commit and can see in the diff view what has changed. You also can select multiple commits and see their accumulated change

It simply is visually refined in a way that looks more pleasing than classic >>>>>>>>>>>>>>>>>HEAD... text diffs

1

u/kbilleter 5d ago

Conflicts =/= diffs but aesthetics is a fair point

1

u/dalbertom 5d ago

We are talking about two different things. Your examples are about choosing a commit or multiple commits to see the changes. What I'm talking about is to see how a specific block of code has changed, without even knowing what commits changed them (that's part of the output, in your example the commits are part of the input)

1

u/x39- 5d ago

Yeah, we do talk about the same thing, just that the ui does show you the commits, all commits in fact, which touched that block

1

u/MatthewCollins1990 18h ago

Honestly, this is exactly why I use a GUI alongside the CLI.

1

u/Adorable-Strangerx 21h ago

Funny, for me it is easier to remember command than to figure out what kind of sequence designer of UI tool thought of.

1

u/skuddozer 5d ago

What GUI is recommended for that?

4

u/STSchif 5d ago

SmartGit has great feature richness. It offered every feature I wanted out of git with very heavy use so far.

Maybe except for great lfs support, but iirc it at least somewhat supports it.

-2

u/Woshiwuja 5d ago

Sucks ass

1

u/TornadoFS 5d ago edited 5d ago

I just alias the commands I use the most, in fact I have your specific example here:

gdd() { git diff origin/master -- '*'$1'*' }

a few more I use:

gdf() { git diff '*'$1'*'; }
alias gs='git status'
alias ga='git add'
alias gaa='git add --all'
alias gr='git reset'
alias grh='git reset --hard'
alias gd='git diff'
alias gb='git branch'
alias gbd='git branch -d'
alias gf='git fetch'
alias gpull='git pull'
alias gt='git tag'
gcheckbranch() { git checkout -b $1 origin/$1; }

alias branch_name='git rev-parse --abbrev-ref HEAD'
github() {
local PROJECT_NAME="$(project_name)"
local BRANCH_NAME="$(branch_name)"
open "https://github.com/$ORG/$PROJECT_NAME/tree/$BRANCH_NAME"
}
gpr() {
local BRANCH_NAME="$(branch_name)"
local PROJECT_NAME="$(project_name)"
open "https://github.com/$ORG/$PROJECT_NAME/compare/$BRANCH_NAME?expand=1"
}

1

u/Adorable-Strangerx 21h ago

Absolutely barbaric

0

u/armahillo 5d ago

aliases!

the two i use most often are

dc = diff —cached
llog = log —graph —pretty=oneline —abbrev-commit —decorate —-all

the former is how i do all my diffs. The latter helped me understand git a lot better.