Does GitHub retain commit history for squash merged PRs indefinitely?
Asked Answered
R

1

7

Our team is deciding on what merge strategy to use in our repo. We're looking at squash merges for the ability to have a clean commit history. However, we want to be able to review intermediate changes if we want more detail on a particular commit - in particular, the intermediate commits on the PR that were squashed.

Normally, squashing and deleting the branch will remove all references to those intermediate commits in the reflog and git garbage collection could clean those up. However, in looking at other repos, it seems like GitHub still retains those intermediate commits.

What we're looking for is confirmation that GitHub is retaining those commit IDs in the reflog and that we're guaranteed they'll stick around. Alternatively, information telling us that's not guaranteed is also good.

Risotto answered 14/6, 2019 at 14:49 Comment(0)
R
2

Apparently it is guaranteed behavior. This document shows that you can check out pull requests locally. This will have the branch's commit history.

Risotto answered 17/6, 2019 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.