3 ms·
Yes. Git push does not remove the previous commit, but changes the HEAD of the branch to be another commit. The old commit becomes unconnected, but you can sti
by rhn_mk1 6y ago
Yes. Git push does not remove the previous commit, but changes the HEAD of the branch to be another commit.
The old commit becomes unconnected, but you can still get to it if you know its hash. There's also a way to list all unconnected commits, which is a bit involved.
Unconnected commits will exist and take up space until garbage collection is done.
- visarga 6y agoIf you pushed by mistake on a remote branch instead of creating a PR from a new branch, then you revert the commit, you're going to have trouble with the PR not showing all the changes because they match the orphaned commit.
- rhn_mk1 6y agoNote that PR is not a fundamental git concept, but something a code forge can decide to implement any way they like. I presume you're talking about GitHub, because in GitLab, you will be able to see all changes when browsing commits constituting the merge request.