doc: update git.md (#472)

Co-authored-by: zlfyuan <741136856@qq.com>
This commit is contained in:
bgbgPang 2023-12-04 11:22:45 +08:00 committed by GitHub
parent 4b8567131f
commit 0f22978db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -563,6 +563,34 @@ $ git fetch --all && git reset --hard origin/master
$ git log Branch1 ^Branch2
```
### git 迁移
- 从原地址克隆一份裸版本库
```bash
$ git clone --bare https://github.com/username/project.git
```
- 然后新建一个地址,比如一下
```bash
$ https://gitee.com/username/newproject.git
```
- 进入project.git这个全裸版本库以镜像推送的方式上传代码到newproject上。
```
$ cd project.git
$ git push --mirror https://gitee.com/username/newproject.git
```
- 使用新地址,直接 Clone 到本地就可以了。
```
$ git clone https://gitee.com/username/newproject.git
```
Git Submodule 子模块
------