【发布时间】:2016-02-04 15:50:32
【问题描述】:
我正在尝试为我的“合并到暂存”工作流程创建一个别名。
假设我在分支“dev/layout_fix”中完成了一项任务,并希望在提交后将其部署到登台。
这是我的方式:
git checkout staginggit merge dev/layout_fix --no-ffgit pushgit checkout dev/layout_fix
现在我尝试了这种方法:
[alias]
branch-name = "!git rev-parse --abbrev-ref HEAD"
stagify = "!git checkout staging && git merge $(git branch-name) --no-ff && git push && git checkout $(git branch-name)"
但由于结帐,别名分支名称是“暂存”。
是否可以在 staging 签出之前将当前分支名称写入变量中?
【问题讨论】:
标签: git bash shell merge git-config