本文件用于记录项目的两个远程仓库信息,以及如何实现两个仓库的同步更新。
| 仓库名称 | 远程别名 | 仓库地址 | 用途 |
|---|---|---|---|
| cnb仓库 | cnb | https://cnb.cool/yiliu/yiliu | 主要开发仓库 |
| GitHub仓库 | github | https://github.com/liuyiliux/CrossGen | 备份和开源分享仓库 |
提交代码到本地仓库:
git add .
git commit -m "你的提交信息"
推送到cnb仓库:
git push cnb master
推送到GitHub仓库:
git push github master
添加两个远程仓库(如果尚未添加):
git remote add cnb https://cnb.cool/yiliu/yiliu git remote add github https://github.com/liuyiliux/CrossGen
使用git push --all命令一次性推送到所有仓库:
git push --all
查看当前远程仓库配置:
git remote -v
为cnb远程仓库添加GitHub的pushurl:
git remote set-url --add --push cnb https://github.com/liuyiliux/CrossGen
查看更新后的配置:
git remote -v
推送代码到两个仓库:
git push cnb master
# 添加cnb仓库
git remote add cnb https://cnb.cool/yiliu/yiliu
# 添加GitHub仓库
git remote add github https://github.com/liuyiliux/CrossGen
git remote -v
# 删除cnb仓库
git remote remove cnb
# 删除GitHub仓库
git remote remove github
git remote show cnb
.git/config:Git配置文件,包含远程仓库信息README.md:项目说明文档,包含GitHub地址如果在仓库同步过程中遇到问题,请联系:
最后更新时间:2026-01-03 版本:1.0.0