Skip to content
quickly run git commands work with multiple repos without switch directory
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
test
.gitignore
.npmignore
.travis.yml
README.md
config.js
help.txt
index.js
package.json

README.md

git-shortcut

Build Status Code Climate npm: Dependency Status

git 命令行下快捷操作其它项目

git-shortcut helps you quickly run git commands work with multiple repos without switch directory

Installation

npm install -g git-shortcut

Usage

使用别名操作项目

g -s b ../blog    # 添加别名 add alias
g b status        # 使用别名 use alias
g b pull
g ../static pull  # 直接操作目录
g push            # 如果没有别名匹配时, g 相当于 git 的别名
                  # work as a alias for git if no alias matched

使用特殊别名 -,用于经常切换于两个 repo 之间时,操作相对应的另一个项目

special alias -, work on the related repo, and vice versa

# cwd Main
g -s - ../static    # 添加`-'别名
g - status          #
cd ../static
g - st              # show status of Main

同时操作多个项目

g -p - pull           # pull current repo and alias `-'
g -p b pull           # pull current repo and alias `b'
g -p -,b pull         # pull current repo, alias `-' and `b'

git-shortcut usage

Remove alias

g -s b ''

Config file

~/.git-shortcut.yml

License

MIT

You can’t perform that action at this time.