现在,当我想快速修复我的项目时,我会这样做:
# create and switch to this new branch
git checkout -b fixes-20130828-01
# push the new branch back to the origin
git push origin fixes-20130828-01
# link local and remote branches
git --set-upstream fixes-20130828-01 origin/fixes-20130828-01
我希望能够通过以下方式执行上述操作:
# is there a way to get this to not only create and switch locally,
# but also to link to remote
git checkout --[something] fixes-20130828-01
# and then this would do the actual push to create
# the branch on the origin, now that it's logically linked up
git push
这将更容易使用、记忆,也更容易向新团队成员解释等,即“您使用此命令基于现有分支创建新分支,然后像往常一样将其推回。”
是否有开箱即用的选项?