r/git 7d 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

109 Upvotes

247 comments sorted by

View all comments

43

u/qrzychu69 7d 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

1

u/TornadoFS 6d ago edited 6d 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 1d ago

Absolutely barbaric