Gpr
Gitkeeper.
Description
Gpr provides a simple management of the git repository.
Behave like a go get of Golang.
For example, all repositories are cloned to $HOME/.gpr/<host>/<user>/<repository>.
It is possible to centrally manage of the all repositories.
Installation
$ gem install gpr
Usage
$ gpr help
Clone a git repository into Gpr directory
Just clone a git repository into $HOME/.gpr/<host>/<user>/<repository>.
$ gpr get <repository url>
Clone all public repositories of the specified user
You can specify host only github.com or bitbucket.org.
$ gpr get <host>/<user>
Show all registered repositories
$ gpr list
github.com - kaihar4/dotfiles
github.com - kaihar4/gpr
$ gpr list --paths
/home/kaihara/.gpr/github.com/kaihar4/dotfiles
/home/kaihara/.gpr/github.com/kaihar4/gpr
Show the status of all registered repositories
$ gpr status
+-----------------+------------------------------------------+---------------------------+
| REPOSITORY NAME | BRANCH STATUS | DIRECTORY STATUS |
+-----------------+------------------------------------------+---------------------------+
| dotfiles | up-to-date with 'origin/master' | Working directory clean |
+-----------------+------------------------------------------+---------------------------+
| gpr | ahead of 'origin/master' by 1 commit | Exist unstaged changes |
+-----------------+------------------------------------------+---------------------------+
Search the specified keyword in registered repositories
Show a list of the files that the specified keyword is included.
Usage:
gpr search
Options:
-f, [--file=FILE] # Filter by filename
-h, [--host=HOST] # Filter by host
-r, [--repository=REPOSITORY] # Filter by repository
Search the specified keyword in registered repositories
$ gpr search 'net/http'
github.com - kaihar4/gpr : lib/gpr.rb
github.com - kaihar4/kaihar4.com : source/articles/2014-06-29-mechanize-scraping.md
$ gpr search 'net/http' -f '.rb'
github.com - kaihar4/gpr : lib/gpr.rb
$ gpr search 'net/http' -r 'kaihar4/kaihar4.com'
github.com - kaihar4/kaihar4.com : source/articles/2014-06-29-mechanize-scraping.md
Update the database to be used for search
$ gpr update
Fetch all registered repositories
$ gpr fetch remote_repo
If you run for short, it means gpr fetch origin.
$ gpr fetch
Change the directory to be cloned
$ export GPR_ROOT=$HOME/develop
Install the zsh completion
$ gpr get https://github.com/kaihar4/gpr.git
$ cd $HOME/.gpr/github.com/kaihar4/gpr
$ rake zsh:install
$ source ~/.zshrc