git gui: add pull and stash commands

It was not easy and took some time but I learned to like git gui tool. It has raw interface and manners but it can be used for most of basic git operations. It is also available everywhere and is deterministic and reliable.

But time to time I miss more advanced commands. Fortunatelly there is possibility to add new commands via gitconfig file. Typically located at ~/.gitconfig path. Then these commands appears in Tools main menu.

First thing I miss is stash functionality. It can be added by following entries added to mentioned file:

[guitool "Stash/show"]
    cmd = git stash show -p

[guitool "Stash/list"]
    cmd = git stash list

[guitool "Stash/pop"]
    cmd = git stash pop

[guitool "Stash/drop"]
    cmd = git stash drop
    confirm = yes

[guitool "Stash"]
    cmd = git stash

It is also annoying to do fetch+merge operations instead of pull. Pull can be easily added by:

[guitool "Pull"]
    cmd = git pull $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) | tr / " ")

It automatically select remote (only one should be active) and active branch. It also expects

Enjoy!

Tags:  GIT 
Last blog articles:
git gui: Add pull and stash commands
Bosch Silence Plus + code E24
Using LXC virtualization for testing server installation
Ubuntu 18.04 and unprivileged LXC
Workspaces grid in Ubuntu 18.04

Tags:
Java Ubuntu Gradle česky Software-architecture personal DIY children React Eclipse DisplayLink AI Spring JavaScript AspectJ neuron SSH LXC JavaFX Immutables Gnome3 GIT FatJar Edison technologies science procrastination pokusy lambda kvas ellipsis destilace chemie alkohol VisualVM Upstart Tomcat Selenium REST PrimeFaces Log4j Jooq Jackson JSF Debug DI CSS

Last tweets: