git-link is a git sub-command for getting a repo-browser link to a git object. The motivation behind git-link is that it is often faster to navigate to a git object or path on the command line than it is to click your way to it through a web interface.
Git link can build urls for the following repo-browser: cgit, gitweb, github, github-private, repo.or.cz.
Usage
git link -h
Usage: git link [options] < commit|tree|blob|path|branch|tag|diff >
Options:
-h, --help show this help message and exit
-v, --version show version and exit
-c, --clipboard copy link to clipboard (overwrites link.clipboard)
-u, --url < url > repo browser base url (overwrites link.url)
-b, --browser < type > repo browser type (overwrites link.browser)
-r, --raw show raw blob if possible
Available repo browsers:
cgit github-private github gitweb repo.or.cz
Configuration:
git config --add link.url < repo browser url >
git config --add link.browser < repo browser >
git config --add link.clipboard false|true
Examples:
git link HEAD~10 -> url to 10th commit before HEAD
git link v0.1.0^{tree} -> url to tree object at tag v0.1.0
git link master:file -> url to file in branch master
git link path/file -> url to path/file in current branch
git link v0.1.0 -> url to tag v0.1.0
Installing
The latest stable version of git link is available on pypi, while the development version can be installed from github:
pip install gitlink # latest stable version
pip install git+git://github.com/gvalkov/git-link.git # latest development version
Alternatively, you can install it manually like any other python package:
git clone git@github.com:gvalkov/git-link.git
cd git-link
git reset --hard HEAD $versiontag
python setup.py install
Development
See repobrowsers.py and test_cgit.py if you are interested in adding a new repository browser.
Please make do without bringing in any external dependencies. As nice as GitPython and libgit2 are, anything that this tool needs from git can be queried using the command line tools.
Requirements:
- Python
Comments not found