|
|
| 第476行: |
第476行: |
| git push -u origin kk_test | | git push -u origin kk_test |
| </syntaxhighlight>|#}} | | </syntaxhighlight>|#}} |
|
| |
| == 迁移 ==
| |
| 查看当前仓库地址。
| |
| {{shc|<syntaxhighlight lang="bash">
| |
| git remote -v</syntaxhighlight>|$|/home/kangkk}}
| |
| === git push --mirror ===
| |
|
| |
| === git remote set-url ===
| |
| 迁移单个分支。
| |
| {{Shc_out|<syntaxhighlight lang="bash">
| |
| git remote set-url origin ssh://git@192.168.31.5:10022/abc/xyz.git</syntaxhighlight>|<syntaxhighlight lang="bash">
| |
| </syntaxhighlight>|$|/home/kangkk}}
| |
| {{shc|<syntaxhighlight lang="bash">
| |
| git push</syntaxhighlight>|$|/home/kangkk}}
| |
|
| |
| 迁移所有分支。
| |
| {{Shc_out|<syntaxhighlight lang="bash">
| |
| cd existing_repo && \
| |
| git remote rename origin old-origin && \
| |
| git remote add origin ssh://git@192.168.31.5:10022/qihoo/medici-doc.git && \
| |
| git push -u origin --all && \
| |
| git push -u origin --tags</syntaxhighlight>|<syntaxhighlight lang="bash">
| |
| 枚举对象中: 81, 完成.
| |
| 对象计数中: 100% (81/81), 完成.
| |
| 使用 12 个线程进行压缩
| |
| 压缩对象中: 100% (59/59), 完成.
| |
| 写入对象中: 100% (81/81), 336.01 KiB | 84.00 MiB/s, 完成.
| |
| 总共 81(差异 15),复用 81(差异 15),包复用 0
| |
| To ssh://192.168.31.5:10022/abc/doc.git
| |
| * [new branch] master -> master
| |
| 分支 'master' 设置为跟踪来自 'origin' 的远程分支 'master'。
| |
| </syntaxhighlight>|$|/home/kangkk}}
| |
|
| |
| 检查仓库地址更改状态。
| |
| {{Shc_out|<syntaxhighlight lang="bash">
| |
| git remote show origin</syntaxhighlight>|<syntaxhighlight lang="bash">
| |
| * 远程 origin
| |
| 获取地址:ssh://git@192.168.31.5:10022/abc/xyz.git
| |
| 推送地址:ssh://git@192.168.31.5:10022/abc/xyz.git
| |
| HEAD 分支:main
| |
| 远程分支:
| |
| main 新的(下一次获取将存储于 remotes/origin)
| |
| refs/remotes/origin/master 过时(使用 'git remote prune' 来移除)
| |
| 为 'git pull' 配置的本地分支:
| |
| master 与远程 master 合并
| |
| </syntaxhighlight>|$|/home/kangkk}}
| |