从裸仓库迁移到 AngusGit
Description and use
Migrating a bare repository to AngusGit enables web browsing, pull requests, code review, and branch protection.
Problem
团队需要在裸仓库上实现拉取请求、行级评审、分支保护和五级权限,但裸仓库仅支持推拉。
Outcome
裸仓库的历史、分支和标签完整迁移,团队获得更丰富的协作功能。
Workflow
- 1. 在 AngusGit 创建空仓库(不勾选 README、.gitignore、许可证)
- 2. 在旧服务器上完整克隆裸仓库:
git clone --bare git@your-server:/srv/git/notes.git - 3. 推送所有分支和标签到 AngusGit:
git push ssh://[email protected]:2222/团队/notes.git --all、git push ssh://[email protected]:2222/团队/notes.git --tags - 4. 如旧仓库主分支为 master,重命名为 main:
git branch -m master main - 5. 让团队成员在本地仓库执行
git remote set-url origin ssh://[email protected]:2222/团队/notes.git并git fetch origin - 6. 在 AngusGit 配置分支保护、权限和 Webhook 以替代旧服务器钩子
Evidence
裸仓库只能推拉代码,没有网页、合并请求和评审;需要先让别人看过再合进 main 时,改在 AngusGit 上发拉取请求,并把裸仓库推到一个新建的空仓库。
裸仓库里的历史、分支和标签都可以原样搬过来。做法是把它完整克隆一份,再推到 AngusGit 上的一个空仓库。
在 AngusGit 建一个空仓库。侧栏 仓库 → 新建仓库。添加 README 文件、添加 .gitignore、选择许可证 三项都不要勾选,否则推送会因为两边历史对不上而被拒绝。
- Record date: 2026-11-01T04:29:02.803Z