Home

Awesome

Git It On

A lot of times we have to look at files on GitHub. But this intrudes our ideal command-line workflow, having to switch to a browser and navigate to the URL. Wouldn't it be nice to just be able to open that file from the command line?

Git It On, the plugin for zshell, comes in here.

Installation

Note: This plugin is stable, but still in active development. I do not yet consider this plugin finished.

Note: This was built on a Mac. Support for Linux is experimental, and has not been tested by the plugin author.

--

Oh-My-ZSH

Assuming you have oh-my-zsh, you can simply write

git clone https://github.com/peterhurford/git-it-on.zsh ~/.oh-my-zsh/custom/plugins/git-it-on
echo "plugins+=(git-it-on)" >> ~/.zshrc

(Alternatively, you can place the git-it-on plugin in the plugins=(...) local manually.)

--

Antigen

Add antigen bundle peterhurford/git-it-on.zsh to your .zshrc wherever you're adding the other antigen bundles.

Zgen

If you’re using Zgen, add zgen load peterhurford/git-it-on.zsh to your .zshrc wherever you're adding your other zgen plugins.

Bash

If you're lame and use bash, you can install this directly to your ~/.bash_profile:

curl -s https://raw.githubusercontent.com/peterhurford/git-it-on.zsh/master/git-it-on.plugin.zsh >> ~/.bash_profile

Train Divider

That's cool... What else?

Well, for GitHub:

And for GitLab:

Gitlab Short Commands:

Gitlab commands also have short alternatives:
glcompare|glcm, glcommits|glco, glhistory|glh, glbranches|glb, glmerges|glm, glissues|gli, glctrlp|glcr, glnetwork|gln

But why even leave vim for the command line?

TODO: Make and link vim companion plugin.

These commands are too long, I want to be even faster!

You can make commands faster by using aliases. Put the following in your .zshrc (or .bash_profile)

#Gitit Aliases
alias myrepos="gitit repo peterhurford" #put your name here (usage: `myrepos <reponame>` to open up your repo.)
alias compare="gitit compare"
alias commits="gitit commits"
alias branch="gitit branch"
alias gistory="gitit history"
alias prs="gitit pulls"
alias myprs="gitit pulls author:peterhurford" #put your name here
alias mybranches="gitit branches mine"
alias gitgrep="gitit grep"
alias ctrlp="gitit ctrlp"

Feel free to change the aliases to whatever you'd like. You can even make them shorter, but the above is what I use. Note that these aliases are not included by default.

If you want more git-related aliases for making your git workflow faster, also look at my Git-aliases.zsh plugin.

Got any more plugins to share?