gg helps you work with git more efficiently, saving you keystrokes for your most prized projects.
Think of gg as a wrapper for the git commands that you run all the time; a wrapper that adds functionality and is aesthetically pleasing.
Hold up. Aren't these basically Git aliases?
There's more to the package than just shortcuts or aliases.
For example, the gg s command presents you with an easy to look at a quick glance status of your repository. In addition, there are aesthetic changes that increase the intuitiveness of Git itself.
Here's a screenshot of the gg s command in action:
You can see the current local branch and its respective remote branch, the latest commit hash and message, the local repository's position in relation with the respective remote repository (alerting you that you should push two commits to reach up-to-date status with the remote repository), the status of staging and commits, and the commits that waiting to be pushed.
All of this from one four character command.
Installation
Linux/OSX
curl -fsSL git.io/gg.sh | bash
(HTTPS installation also available via curl -fsSL https://git.io/gg.sh | bash)
All this installation script does is download the gg script, make it an executable, and copy it to your $PATH (/usr/local/bin). For copying to your $PATH, it may require you to enter your password. If there is a better way to do this, please send in a pull request.
To take advantage of user-specific features (such as gg cl <your-repository>), make sure you git config --global --add gg.username <your-username>.
If you use oh-my-zsh, gg is already aliased to git gui citool. If you don't use this alias, you can unalias it in your .zshrc file by adding unalias gg at the end of .zshrc.
gg relies solely on git and attempts to use built-in Shell features over external programs, such as using Bash substitution instead of sed.
Windows:
Note: This assumes that you already have the git installed on your system and
it is configured to be used on the command line.
Open a Command Prompt window and navigate to a folder included in your PATH.
usage:
gg [options] [COMMAND] [args]
commands:
gg Display this help information
gg i Initialize new Git repository
gg ig List available .gitignore templates
gg ig <template> Add .gitignore file from <template>
gg igf <file ...> Add all <file>(s) to .gitignore
gg cl <url> Clone repository from <url>
gg a Add all files
gg a <file ...> Add all <file>(s)
gg c <message> Add all files and commit with <message>
gg cn <message> Commit with <message>
gg uc <count> Go back (uncommit) <count> commits
gg rc <message> Add all files and recommit (amend) with <message>
gg rcn <message> Recommit (amend) with <message>
gg p Push all commits to remote
gg pl Pull all commits from remote
gg f Fetch all commits from remote
gg s Display repository status
gg l Display repository commit log
gg b List all branches in repository
gg b <branch> Create and checkout <branch>
gg ch List all branches in repository
gg ch <branch> Checkout <branch>
gg in <hash> Display info about <hash>
options:
-V, --version Output current version of Git Goodies
-h, --help Display this help information
请发表评论