这是在 2010 年 5 月随 Git v1.7.2-rc0 引入的,提交 3d8b694并添加注释:
\n\n\n添加 git 远程设置分支
\n添加 \xe2\x80\x98
\ngit remote set-branches\xe2\x80\x99 以使用一个“瓷器级”命令更改远程存储库的跟踪引用列表。
\n这\n补充了长期存在的 \xe2\x80\x98git remote add --track\xe2\x80\x99 选项。该界面基于 \xe2\x80\x98git Remote set-url\xe2\x80\x99 子命令。
\nRun Code Online (Sandbox Code Playgroud)\ngit remote set-branches base --add C\ngit remote set-branches base A B D\ngit remote set-branches base --delete D; # not implemented\n
因此,不是使用默认的全局引用规范来跟踪refs/remotes/<name>/命名空间下的所有分支,而是更新引用规范以仅跟踪<branch>
git remote add -t main o2 https://github.com/git/git\nRun Code Online (Sandbox Code Playgroud)\n会给出:
\n[remote "o2"]\n url = https://github.com/git/git\n fetch = +refs/heads/main:refs/remotes/o2/main\nRun Code Online (Sandbox Code Playgroud)\n代替:
\n fetch = +refs/heads/*:refs/remotes/origin/*\nRun Code Online (Sandbox Code Playgroud)\n添加分支将是:
\n git remote set-branches o2 --add master\n[remote "o2"]\n url = https://github.com/git/git\n fetch = +refs/heads/main:refs/remotes/o2/main\n fetch = +refs/heads/main:refs/remotes/o2/master\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
3385 次 |
| 最近记录: |