Git History Rewriting

The cluster discusses the mutability of Git commit history, including methods like force pushes, rebasing, reflogs, and tools for rewriting or cleaning history, along with debates on whether history can be truly deleted or preserved.

➡️ Stable 0.5x DevOps & Infrastructure
2,813
Comments
18
Years Active
5
Top Authors
#9019
Topic ID

Activity Over Time

2009
25
2010
51
2011
64
2012
55
2013
143
2014
151
2015
157
2016
172
2017
129
2018
113
2019
196
2020
251
2021
256
2022
268
2023
271
2024
241
2025
243
2026
27

Keywords

SCM GitJournal N.B GC OP LLM ycombinator.com atlassian.com HEAD GitHub history git commit rewrite repo commits prs rebase branch rewriting

Sample Comments

shabbyrobe Nov 17, 2017 View on HN

Watch out! The "pure and perfect git history is more important than any other consideration" crowd are going to take you apart for this heretical notion!

tene Jan 20, 2012 View on HN

In git, if you rewrite history, your old history is still available via the reflog; nothing is lost.

gmueckl Oct 10, 2024 View on HN

Not sure how much good that does. Git history is mutable.

vhanda May 3, 2022 View on HN

Hello GitJournal author here.I was surprised to read "surprised" cause even if GitJournal choose badly, the history is still there.Nevertheless thanks for letting me know. I'll bump it in my internal Todo list.

1oooqooq Feb 21, 2024 View on HN

thanks. i will have to try it out. but it does sound like "rewriting history" in git et al.

skyebook Nov 16, 2013 View on HN

Genuine Curiosity: How else can you destroy/rewrite history in git besides a force push and gc?

NelsonMinar Sep 13, 2023 View on HN

Wow that's ugly, particularly the part about hiding the change in the repo history.

f00zz Aug 16, 2020 View on HN

Not really erased, maintainers must have a local copy of the history and can just force push

tty2300 May 27, 2019 View on HN

Git allows rewriting history though.

jart Aug 24, 2022 View on HN

GitHub never deletes anything you push. Even if you rebase and force push, that old information is still accessible. Also why would you drag out such an ugly article to make a point?