0

If I have a bunch of merge commits on a branch, if I use

git reset --soft <old_sha>

will git remove/delete the commits between old_sha and the most current commit - git does garbage collection right? Just looking to save disk space.

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

2

git reset only resets the HEAD to the specified state, see the docs. You need the git gc command to delete the unnecessary objects from the disk. See the docs for the details.

Yuri G.
  • 4,323
  • 1
  • 17
  • 32