git_well模块
项目描述
阅读文档 |
|
Github |
|
Pypi |
Git Well 是一组git命令行工具,也是Python模块。
安装此模块将安装 git-well 命令,这是一个模态CLI,包含多个新的git命令。这些git命令也作为独立的“git”可执行文件暴露。
换句话说,在您
pip install git-well
要获取CLI参数完成安装 autocomplete,您可以使用全局自动完成
pip install argcomplete
mkdir -p ~/.bash_completion.d
activate-global-python-argcomplete --dest ~/.bash_completion.d
source ~/.bash_completion.d/python-argcomplete
并将此内容添加到您的 .bashrc
if [ -f "$HOME/.bash_completion.d/python-argcomplete" ]; then
# shellcheck disable=SC1091
source "$HOME"/.bash_completion.d/python-argcomplete
fi
注意:如果您知道如何使这更容易,请告诉我!
然后您可以运行
# Show all the commands exposed by this repo.
git well --help
git well sync --help
# OR
git sync
顶级CLI
usage: git-well [-h] {squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote} ...
options:
-h, --help show this help message and exit
commands:
{squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote}
specify a command to run
squash_streaks Squashes consecutive commits that meet a specified criteiron.
branch_upgrade Upgrade to the latest "dev" branch. I.e. search for the branch
sync Sync a git repo with a remote server via ssh
branch_cleanup Cleanup branches that have been merged into main.
track_upstream Set the branch upstream with sensible defaults if possible.
rebase_add_continue
A single step to make rebasing easier.
remote_protocol Helper to change a remote from https to ssh / git for a specific user /
discover_remote Attempt to discover a ssh remote based on an ssh host.
此模块中的工具源自
用例
您在运行 git pull 时是否遇到过此错误?
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> the_current_branch
我发现这非常痛苦,因为它甚至不愿意填充 <分支>,因此您必须修改命令来输入
git branch --set-upstream-to=origin/the_current_branch the_current_branch
我理解他们为什么这么做,远程分支可能具有不同的名称。但……通常不是。这就是为什么我实现了 git-well track-upstream。
运行此命令将检测您是否处于简单情况,并为您执行。否则,它将列出您的选项,并要求您选择一个。
我发现此命令可以防止很多干扰,因此将安装git-well install git track-upstream 作为其自己的命令。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源分布
git_well-0.2.3.tar.gz (42.7 kB 查看散列)
构建分布
git_well-0.2.3-py3-none-any.whl (46.2 kB 查看散列)
关闭
git_well-0.2.3.tar.gz 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | f60987a4db481f3eb37fd0d2d62e242cfb582221dae6c88e2ceb501d67346104 |
|
MD5 | 01bd64a403cb71f0366c3387b2f361a8 |
|
BLAKE2b-256 | b3a036f8cafa7fed086ca9fdfd327f54bc94e222b8632216b96584a7f924b8f4 |
关闭
git_well-0.2.3-py3-none-any.whl 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 57c1870355e77664b88ab491f824765b2934bdd43ab922c0030140c996c550d5 |
|
MD5 | 8f2fda52c44be84a93af1ae6e6ec6a32 |
|
BLAKE2b-256 | 946abc2c1a76dd0149f9be8677f585e0035da9713129869b1aae9862d50d04a0 |