gite

02 December 2020

I like git and as I’m automating a lot of my pain points, I had to extend git to fit my workflow. That is why I created gite. I also took this opportunity to poke around with Homebrew and create my own “tap”.

Here are the commands that gite provides (ordered by my favorites to the ones I forgot existed):

git hub

Opens your git hosting provider in your $BROWSER. It allows me to quickly pull up my github repository without finding it in one of my 203 opened tabs… It provides a few nice options:\

  • -g to open in the background
  • --pr to go directly to the “compare” view between your current branch and your base branch
  • -c to view your latest commit

git uu

You merge branches and then you are suddenly facing: UU. Oh no conflicts! This command will open all your conflicted files into your $EDITOR (hint: it is vim).

git root

Mostly used inside bash scripts, it is returning the root folder on your git repository.

git name

Same as the previous command, it will generate the git provider hosting name. For gite , it will output: boertel/gite

git iam

Which author do I want my commits to be for that repo? Some repositories need to be under my work email, some under my personal email, some under a third party email (contracting work). I can switch between these and set it up per repo-basis: git iam me for my personal email, git iam work for my work one.

git brew

Since I tried to get started to create my own Homebrew Tap. It is a pain to have to write your Formula .rb file every time you release a new version. git brew will generate that for me!

git hook

I used to have a git hook on commit to take a picture from my webcam and post it on Twitter: https://twitter.com/gitpushmyface (it stopped working, and I never fixed it). So that command was an easy shortcut to test out that the script.

git wip

Ever get your Monday started and you don’t know where you left out your work. git-wip will open all your modified files into your $EDITOR.

git pages

It opens your GitHub Pages in your browser if it exists.

git publish

Still with GitHub Pages, it merges and push your branch into gh-pages.

git monitor

I forgot about that one because I used to use it to open Opbeat Monitoring tool (but they got bought by Elastic. But I noticed that it can open Heroku dashboard. Maybe I’ll create a git heroku command.

git release

That one will be prior to git-brew, it creates a new GitHub release so git-brew is able to fetch the archive for the newly created version.

git ico

It stands for interactive checkout and it fetches all your remote branches and give you the choice to checkout any of these branches locally.

git migration <pattern>

It looks up for a pattern and open all files that contains it.

git trim

Go through your local branches and give you the choices to remove them.

I realize that some of these are outdated or should be aliases but they work for me.

If you want to give it a go:

$ brew tap boertel/tap
$ brew install gite

What I learned

  1. Any command in your $PATH that starts with git-* will be able to be called as a git subcommand
  2. If you want your own Homebrew Tap, you need to host it under boertel/homebrew-tap even if you are adding: boertel/tap
  3. Remember make and bash are sometimes just enough

What about the name?

gite can stand for “git extended” or from the French gîte that means cottage.