git hub lets you use your github account from the command line. Among other things, it lets you create and fork repositories, or file pull requests.
To install the latest released version:
pip install hub
To install the latest development version:
pip install http://seveas.net/git-hub
The first time you use git hub, it will ask you for your github username and password. It then requests (and stores) an API authentication token, so you can always revoke access from your profile page.
The authentication token is stored in ~/.githubconfig. Never share this token with anyone as it gives full access to your github account.
A simple command to try out is git hub whoami, which tells you what github thinks about who you are. For example:
dennis@lightning:~$ git hub whoami Github user: seveas GitHub password: Dennis Kaarsemaker Profile https://github.com/seveas Email email@example.com Blog http://www.kaarsemaker.net Location Amsterdam Company Booking.com Repos 36 public, 0 private Gists 4 public, 0 private RSA key ...N0nFw3oW5l (Dennis)
If you want to see this information about other users, use git hub whois:
dennis@lightning:~$ git hub whois sigmavirus24 Ian Cordasco Profile https://github.com/sigmavirus24 Email firstname.lastname@example.org Blog http://www.coglib.com/~icordasc/blog Repos 21 public, 0 private Gists 9 public, 0 private
List all repositories owned by a user, by default you.
Add SSH public keys (default: ~/.ssh/*.pub) to your account.
Display all public keys of a user, in a format that can be added to ~/.authorized_keys.
Displays a log of your github actions, such as pushes and issue comments. You can also specify a user or repository and the relevant log will be shown instead of yours.
Create a repository on github for your current repository. An optional description can be given too. After running this command, a repository will be created on github and your local repository will have github as remote “origin”, so git push origin master will work.
Fix the configuration of your repository’s remotes. Remote “origin” will be set to your github repository. If that repository is a fork, remote “upstram” will be set to the repository you forked from.
Clone a github repository by name (e.g. seveas/hacks) or URL. If it’s a fork, the “upstream” origin will be set up too.
Fork another person’s git repository on github and clones that repository locally. Repo can be specified as a (git) url or simply username/repo. Like with set-origin, the “origin” and “upstream” remotes will be set up too.
List all forks of this repository, highlighting the original repository.
Add a users fork as a remote using the user’s login as name for the remote.
Browse the repository (or its parent) on GitHub
Mirror a repository from github. This is similar to clone, but clones into a bare repository and maps all remote refs to local refs. When run without argument, the current repository will be updated. You can also specify user/* as repository to mirror all repositories of a user.
When you use the --goblet option, the resulting mirror will be configured for the goblet web interface, using description, owner and clone information from github.
Show all service hooks for this repository.
Add a hook to this repository with the appropriate settings. Settings can be found in the hooks page on github. One setting all hooks accept is events, a comma-separated list of events this hook will be triggered for. A list of all events can be found on the GitHub API page
Edit one or more settings for a hook.
Remove a service hook.
List all open issues. You can specify filters to filter issues. When you specify --parent, list all open issues for the parent repository.
Shows details about the mentioned issue numbers. As with issues, you can use the --parent option to use the parent repository.
Files a pull request to merge branch “yours” (default: the current branch) into the upstream branch “theirs” (default: master). Like for a commit message, your editor will be opened to write a pull request message. The comments of said message contain the shortlog and diffstat of the commits that you’re asking to be merged. Note that if you use any characterset in your logs and filenames that is not ascii or utf-8, git hub will misbehave.
If you specify an issue number, that issue will be turned into a pull request and you will not be asked to write a pull request message.
Creates a gist (with optional description) from the named files. If you specify - as filename, stdin will be used, making it easy to pipe command output to github, for example: fortune | git hub gist -
List your gists, or those created by another user.
Github provides .gitignore templates for various languages and environments. This command will let you quickly grab them and add them to your .gitignore. For example: git hub ignore Python C
Generates a graphviz graph of people following you, people you follow or people who’s repositories you’ve forked. For example:
git hub network | dot -T png -Grankdir=LR > network.png