Git/清理:修订间差异
来自康健生活
< Git
| 第6行: | 第6行: | ||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
git rebase -i [commit_id]</syntaxhighlight>|$|/home/kangkk}} | git rebase -i [commit_id]</syntaxhighlight>|$|/home/kangkk}} | ||
== orphan == | |||
{{shc|<syntaxhighlight lang="bash"> | |||
git checkout --orphan <new-branch-name> | |||
git add . | |||
git commit -am "Initial commit" | |||
git branch -D <old-branch-name> | |||
git branch -m <old-branch-name> | |||
git push -f origin <old-branch-name></syntaxhighlight>|$|/home/kangkk}} | |||
2025年4月20日 (日) 12:15的版本
标题文本
清理优化本地版本
/home/kangkk
git gc --prune=now
rebase
/home/kangkk
git rebase -i [commit_id]
orphan
/home/kangkk
git checkout --orphan <new-branch-name>
git add .
git commit -am "Initial commit"
git branch -D <old-branch-name>
git branch -m <old-branch-name>
git push -f origin <old-branch-name>
No categories