Forgit: A utility tool powered by fzf for using Git interactively
99 points by kdheepak 3 years ago | 24 comments- kbd 3 years agoIf anyone cares, I do something similar with my git aliases: https://github.com/kbd/setup/blob/master/HOME/.config/git/co...
So, "ga" similarly gives a fuzzy finder of files to "git add" that are actually in git status, "gcp" lets me cherry pick one or more commits from a branch where both the branch and commits are picked with fzf, and so on.
- slaymaker1907 3 years agoAliases are awesome, I use "git config --global alias.pwd 'symbolic-ref --short HEAD'" for easier management of branches. Instead of "git push -u origin really-long-branch-name", I can just do "git push $(git pwd)".
- kbd 3 years agoHere’s what I do for that (aliased to ‘p’): https://github.com/kbd/setup/blob/d95653da5ab367b1e628b97537...
- kbd 3 years ago
- WalterGR 3 years agoHave you published those tools? I don't find anything relevant via Googling nor searching your repos.
- slaymaker1907 3 years ago
- awsation 3 years agoI use Tig [0] and highly recommend it. I do cherry picks there view blames, git greps, among other things.
- OJFord 3 years agoNice. I do something similar with simple scripts for fuzzy finding a file/sha, and then call them in place of one being expected, but this might tempt me to let someone else maintain it (with undoubtedly more thought and time put into it by a long shot) instead :)
https://github.com/OJFord/fzutils
I dislike all the short acronym-style aliases though; (I know it's fairly popular with git) not immediately obvious if it's supported to just use the usual commands.
- user3939382 3 years agoThis is awesome although I solve these problems a different way for my workflow. If I really need to dive into git I use Tower. For adding to a commit, I basically never need to add anything less than everything. In 1 step I add everything and commit with a message without needing quotes:
# git config alias.add-commit !git add -A && git commit # .bash_profile # Use like: gac this is my commit message function gac () { git add-commit -m "$*" }
- coding123 3 years agoThat's one crazy fancy ui for a terminal app.
- WalterGR 3 years agoThat UI is beautiful! What's their special sauce?
- WorldMaker 3 years agoA nice Terminal color theme and a good font with PowerLine symbols.
- WalterGR 3 years agoWhich UI toolkit?
- WorldMaker 3 years agoSkimming the code, it's a shell script so it is mostly bespoke and much of it just git's built-in color formatting! Also presumably some of it is fzf's UI, too. There's an even less documented helper ruby app called "emojify" from the same author that I couldn't quite figure out what it does, given the name I assume it converts something to emojis, but what and where I didn't ascertain in a brief skim.
(ETA: There's some confusion here too, because some of those screenshots is a likely unrelated "status bar" tool and a Starship-like prompt. Might even be Starship.)
- WorldMaker 3 years ago
- WalterGR 3 years ago
- metadat 3 years ago* TUI, aka Text UI
- WorldMaker 3 years ago
- PhantomBKB 3 years agoGuy works at bytedance (creators of TikTok, and notoriously known for making use of intrusive telemetry), hasn't released source code, hence I can't trust this application.
- anaganisk 3 years agoIsn’t it an irony that he open sourced his application yet you don’t trust him? Is it because he is from a Chinese origin, too closely flying around being a racist. By that logic we cant trust React, RocksDB and other libraries from Facebook, which has done equal or even more shady stuff.
- PhantomBKB 3 years agoI missed the fact that he released the source.
- PhantomBKB 3 years ago
- anaganisk 3 years ago
- nittanymount 3 years agothis is nice with the TUI, but need to remember these shortcut commands, maybe will get used to or remember them after start using them...
- gremlinsinc 3 years agoyou could create a bash function that echo's out the aliases, or perhaps feed it a keyword and it greps the commands and only gives you the ones you need.
something like:
You could even have more fun w/ it by creating some script that maybe remaps all your git commands so whenever you manually do git commit <flags> -- it'd run the command then also convert your command to a string, and run each word matching like commit, rebase, etc through fgit, and create some sort of "you could've done this instead"... I'd love if zsh had more things like that, but I only recently switched to zsh and oh-my-zsh is it so much better.fgit(){ fgcommands = "git commit...\n,git rebase...\n" # you want one per line, so I'm not perfect at bash, w/out looking up how to do it I think you could cat it into the commands. if [ -z $1 ]; then echo "$fgcommands" # returns all commands else echo "$fgcommands" | grep commit" # returns all commands with commit in. fi }
Think of this like in vscode when you use the command search, and it shows the keybindings next to it, so you can learn to do it better...
- gremlinsinc 3 years ago