Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将 git 配置为默认将我当前的分支推送到原点?
例如,我想做:
git push origin
并让它将我当前签出的任何分支推送到上游来源。
设置push.default为tracking。
push.default
tracking
$ git config --global push.default tracking
现在git push只推送您当前所在的分支,假设已配置上游分支(请参阅 参考资料git branch --set-upstream)。
git push
git branch --set-upstream