git问题:
工作中遇到的git问题记录📝问题1:
git push提交代码之后报错 但是不影响提交后果
error: The last gc run reported the following. Please correct the root cause
and remove gc.log.
Automatic cleanup will not be performed until the file is removed.
warning: There are too many unreachable loose objects; run 'git prune' to remove them.
————————————————
解决方案:
直接运行git gc --prune=now把所有的悬空对象都清空批量删除分支:
git branch | grep '文件名匹配' | xargs git branch -d
git branch 查看本地分支
| grep ‘branchName‘ 匹配分支名
| xargs git branch -D 将匹配到的分支名一个一个传递给git branch -D
git branch -D branchName 删除本地分支
文章讲述了在工作中遇到的Git问题,如提交后报错不影响提交但提示有过多悬空对象,提供了解决方案(gitgc--prune)和批量删除本地分支的方法。
1万+

被折叠的 条评论
为什么被折叠?



