在一个分支上开发,有一些commit没有merge进master,后来放弃这个分支,不想继续开发了,那么这些没merge的commit就丢失了,称为dangling

想要清除这些commit,运行:

git reflog expire --expire-unreachable=now --all
git gc --prune=now

参考资料:

http://stackoverflow.com/questions/3765234/listing-and-deleting-git-commits-that-are-under-no-branch-dangling

 

相关文章:

  • 2021-05-26
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-02-16
猜你喜欢
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2022-12-23
  • 2020-12-29
相关资源
相似解决方案