Skip to content

Instantly share code, notes, and snippets.

@dersam
Last active May 28, 2024 22:14
Show Gist options
  • Save dersam/0ec781e8fe552521945671870344147b to your computer and use it in GitHub Desktop.
Save dersam/0ec781e8fe552521945671870344147b to your computer and use it in GitHub Desktop.
Open GitKraken using the current repo directory in the cli.
## Open GitKraken using the current repo directory.
## For when you want a prettier view of your current repo,
## but prefer staying in the cli for most things.
## This will break if GitKraken ever removes the -p flag.
## If you're not using OSX, the path is definitely different.
kraken () {
~/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $(pwd)
}
# If you want a git alias, add the following to your git config under [alias]
kraken = !"~/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $(pwd)"
# Now you can 'git kraken'!
@jebeaudet
Copy link

I added this to my .bashrc and it works like a charm in any directory inside a git repo you might be

function kraken() {
  open -na 'GitKraken' --args -p $(git rev-parse --absolute-git-dir)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment