快速回忆:
git push origin -u Feature_new_branch
使用 -u参数
背景
如果本地新增branch,修改后直接 git push 可能会失败。怎么办? -u来解决
简要记录:
git checkout -b Feature_new_branchvim xxx.cgit add xxx.cgit commit -m "xxx.c create"git push origin Feature_new_branch#可能失败,如果服务端不允许git push origin -u Feature_new_branch- 或者 git config设置 --set-upstream来建立本地分支与压断分支之间的关联
备注:如果远端开启了分支保护类似的功能。无法直接push新的本地分支。
help 信息
git push --help

结论:
git push origin -u Feature_new_branch 就可以快速提交
gitpushwith-u:快速创建并推送新分支的解决方案
本文介绍了在Git中,当本地创建新分支并修改后,如何使用-u参数避免gitpush失败的情况,特别关注了服务端分支保护对推送的影响以及gitconfig设置。结论是gitpushorigin-uFeature_new_branch是解决这个问题的有效方法。
846

被折叠的 条评论
为什么被折叠?



