Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
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.
git reset
git gc
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.