查看“︁Git/清理”︁的源代码
来自康健生活
←
Git/清理
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文本 == == 清理优化本地版本 == {{shc|<syntaxhighlight lang="bash"> git gc --prune=now</syntaxhighlight>|$|/home/kangkk}} == rebase == {{shc|<syntaxhighlight lang="bash"> git rebase -i [commit_id]</syntaxhighlight>|$|/home/kangkk}} == orphan == {{shc|<syntaxhighlight lang="bash"> git checkout --orphan <new-branch-name> git add . git commit -am "init" // 删除所有本地旧分支 git branch -d <old-branch-name> // 删除所有远程旧分支, 主分支需要临时打开分支保护 git push origin :<old-branch-name> -f git checkout -b <main-branch-name> // 推送新的主分支到远程 </syntaxhighlight>|$|/home/kangkk}} == 大文件 == 检索 git 项目目录 {{shc|<syntaxhighlight lang="bash"> git rev-list --objects --all</syntaxhighlight>|$|/home/kangkk}} 延申出 {{shc|<syntaxhighlight lang="bash"> git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')"</syntaxhighlight>|$|/home/kangkk}} 删除大文件 {{shc|<syntaxhighlight lang="bash"> git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch <文件路径名称>' --prune-empty --tag-name-filter cat -- --s</syntaxhighlight>|$|/home/kangkk}}
此页面嵌入的页面:
模板:Shc
(
查看源代码
)
模板:Shc/style.css
(
查看源代码
)
返回
Git/清理
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。