Git/源

来自康健生活
< Git
Kangkk​(留言 | 贡献)2026年11月5日 (四) 19:13的版本 (→设置多源)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

标题文本

设置多源

代码同步到多个仓库时要分别命名 repo, eq:

Bash-icon-svgrepo-com.svg
$
# 添加第一个远程<github>仓库<wiki.git> 别名:github-repo
git remote add github-repo <github-repo-url>

# 添加第二个远程<coding.net>仓库<wiki.git> 别名:coding-repo
git remote add coding-repo <coding-repo-url>

测试

Bash-icon-svgrepo-com.svg
$
git remote -v

提交代码:

Bash-icon-svgrepo-com.svg
$
git push github-repo master:feature/v0.0.1 && \\
git push coding-repo master:feature/v0.0.1