解决仓库分支过多问题
问题:
C:\02gaoke\00Practice>git clone http://git.gaokeyun.cn/yangqiang/seu2021_doc.git |
原因分析:
分支过多导致的问题
解决办法:
关闭压缩功能
C:\02gaoke\00Practice>git config --global core.compression 0
克隆最近修改的文件
C:\02gaoke\00Practice>git clone --depth 1 http://git.gaokeyun.cn/yangqiang/seu2021_doc.git
Cloning into 'seu2021_doc'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), 218 bytes | 19.00 KiB/s, done.
然后获取完整库
C:\02gaoke\00Practice>cd seu2021_doc
C:\02gaoke\00Practice\seu2021_doc>git fetch --unshallow
remote: Total 0 (delta 0), reused 0 (delta 0)
拉取所有数据
C:\02gaoke\00Practice\seu2021_doc>git pull --all
Fetching origin
Already up to date.
本地创建分支
C:\02gaoke\00Practice\seu2021_doc>git branch
* master
C:\02gaoke\00Practice\seu2021_doc>git branch yq2021
切换本地分支
C:\02gaoke\00Practice\seu2021_doc>git checkout yq2021
Switched to branch 'yq2021'
添加到本地库
C:\02gaoke\00Practice\seu2021_doc>git add *
C:\02gaoke\00Practice\seu2021_doc>git commit -m "yq2021"
[yq2021 d5cd6e5] yq2021
1 file changed, 1 insertion(+)
create mode 100644 "\346\246\202\350\246\201\350\256\276\350\256\241/my.py"
提交到服务器的分支
C:\02gaoke\00Practice\seu2021_doc>git push -u origin yq2021
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 412 bytes | 206.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
To http://git.gaokeyun.cn/yangqiang/seu2021_doc.git
* [new branch] yq2021 -> yq2021
Branch 'yq2021' set up to track remote branch 'yq2021' from 'origin'.
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 啦啦啦の生活馆!
评论