Tool for managing where your source code lives! Find code and stay organized easier.
Your configurable source path will have directories namespaced by
organization and repository ($HOME/src/github.com/r-medina/gito
, for
example).
gito get github.com/r-medina/gito # defaults to GOPATH[0]/src/github.com/... or $HOME/src/...
the get
command needs a full(ish) name/url - from then on you can
refer to repos by a subset of their names (eg “r-medina/gito” or
“gito”).
gito where r-medina/gito # $HOME/go/src/github.com/r-medina/gito
Can also find code with just repo name
gito where gito # $HOME/go/src/github.com/r-medina/gito
Which you can easily cd into
cd $(gito where gito)
gito url gito # https://github.com/r-medina/gito
open $(gito url gito) # opens in brownser
gito set r-medina/gito <path> # saves the location information to path
gito where r-medina/gito # <path>
when a repo’s location is set, only that name can be used, but you
can set r-medina/gito
and gito
to <path>
so that both work!
gito alias g github.com/mvdan/garble
gito where g # $HOME/go/src/github.com/mvdan/garble
gito alias d dotfiles
gito set dotfiles ~/.dotfiles # $HOME
cd $(gito where d)
see config for how to set these up, but
gito -w=work where gh # $HOME/where-i-keep-work-code/src/github.com/github
usage: gito [<flags>] <command> [<args> ...]
Manage code intelligently.
See http://github.com/r-medina/gito for documentation.
Flags:
-w WORKSPACE which workspace to use (defaults to first in config)
Commands:
help
show this message
get <repo>
download a repo
where <repo>
find out where repo lives
url [<repo>|.]
get the url of the repo (for web browsing) - can also pass no argument or "." for current directory
alias <alias> <to>
alias a name to something - eg "k8s" -> "github.com/kubernetes/kubernetes"
set <alias> <location>
for code living outside your configured path, tell gito where to find it
gito cannot do shell expansion for now, so add full paths to the config file.
workspaces:
- name: personal
path: "/Users/ricky"
aliases:
g: gito
d: dotfiles
custom:
dotfiles: "/Users/ricky/.dotfiles"
- name: work
path: "/Users/ricky/gh"
aliases:
ghe: super-secret
custom:
super-secret: "somewhereElse/theMoneyMaker
go install -u github.com/r-medina/gito
Add the following to your shell:
whence gito > /dev/null || return
gicd() {
cd $(gito where $1)
}
gpen() {
open $(gito url $1)
}
This makes going into your source code directories really easy gcd
gito
as well as opening the repository in a web browser.
- only works with git
- only tested with github