How to remove unneeded git commits?

后端 未结 2 721
自闭症患者
自闭症患者 2021-01-04 11:44

I have some garbage commits in my git repositry. These have been created by e.g. the git gui when changing the latest commit again and accidently creating additional commits

相关标签:
2条回答
  • 2021-01-04 12:17

    Try this:

    git reflog expire --expire=now
    git gc --prune=now
    
    0 讨论(0)
  • 2021-01-04 12:19

    Do the below:

    git config gc.reflogexpireUnreachable now
    git gc --prune=now
    git config --unset gc.reflogexpireUnreachable
    
    0 讨论(0)
提交回复
热议问题