←back to thread

Oh Shit, Git?

(ohshitgit.com)
464 points Anon84 | 2 comments | | HN request time: 0s | source
Show context
behnamoh ◴[] No.42729165[source]
Git is one of those technologies that I never got to wrap my head around of, because in so many ways it doesn't follow intuition and unless you have been using it for a long time, for literally every action you would probably have to Google or use the man page of the command.
replies(4): >>42729343 #>>42729639 #>>42729962 #>>42733024 #
nomel ◴[] No.42729343[source]
I was trying to delete a file from history yesterday.

The built in way (filter-branch) pops up a warning, with a long delay, saying you should hit Control+C and go download a third party python script called filter-repo...

replies(1): >>42729380 #
PaulDavisThe1st ◴[] No.42729380[source]
Possibly consider that "deleting a file from history" is rather far outside the norm or recommended practice for git (even though it is, of course, entirely possible)
replies(1): >>42729476 #
nomel ◴[] No.42729476[source]
> even though it is, of course, entirely possible

I take the more realistic perspective: until git makes it impossible to commit something that shouldn't have been, like a secret, then deleting a file from history is a fundamental requirement of git.

replies(2): >>42729598 #>>42730234 #
1. lcnPylGDnU4H9OF ◴[] No.42730234[source]
Even if you purge the history, the secret is compromised and you should stop using it. It's moot whether or not you're able to remove it from history.
replies(1): >>42741430 #
2. nomel ◴[] No.42741430[source]
That's, for secrets. Secrets aren't the only thing one might want to remove retroactively.