Live data from Hacker News

Quickly rewrite Git repository history

github.com

11–15 of 15 posts

Re: Quickly rewrite Git repository history

#11

This tool really helped when I was migrating code across repositories. Thanks a lot!

Finding this usefull on migration. But I am puzzled when the migration has changed the file names and put the files on a new path, especially copying the files into a separate folder (non git) and the creating the version controlled folder which serves as the final codebase

Re: Quickly rewrite Git repository history

#12
post #5

I'm not a git user (it's true, I'm not a professional dev and use fossil for my pet projects) so honest question: why would you want to rewrite your history?

- Because the history actually represents causality and not wall clock time, and a change belongs logically and semantically into some other changeset.

- Because you want to restructure the project for the whole history, prior to merging several projects.

Re: Quickly rewrite Git repository history

#13
post #5

I'm not a git user (it's true, I'm not a professional dev and use fossil for my pet projects) so honest question: why would you want to rewrite your history?

One use case: you adopted a (new?) formatter, now tracking the evolution of a line/its vicinity is a lot more difficult past that. So you apply the formatter to every commit since the beginning. Literally it's not the true history of what the code looked like, but semantically it is, and it's more useful.

Re: Quickly rewrite Git repository history

#14
post #7
post #6

Earlier quoted context omitted.

Personality have needed for the following reasons (when wanting to preserve history): removing personal info, removing sensitive keys/passwords that were accidently committed a long time ago, splitting a repo. There's lots of use cases

I support anti-dox/and security practices by cleaning up repo history and rotating where you can, as long as your safe with the assumption that anyone with a copy of the history could push it back to central at any point. But I really don't like the trend of some folks "need a clean history" and then disabled merge commits. It's like they are saying "cool snap shot system you got there, id hate for it to be use to ta…

It looks pretty :)

Re: Quickly rewrite Git repository history

#15
post #5

I'm not a git user (it's true, I'm not a professional dev and use fossil for my pet projects) so honest question: why would you want to rewrite your history?

Splitting subfolder into separate repo is full history rewrite. Changing commit message or commit tree is full history rewrite. Also, if you maintain local changes, you want your rebase onto vendor be super easy, meaning you want to groom your history into nice set of changes, not "reverted: reverted: really fix bug #123 for real" tangle. Rebase itself is a history rewrite.
Post reply on HN