-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a tip to remove sensitive data from history (after a push) #153
Conversation
@@ -187,6 +188,11 @@ git help -g | |||
git log -S'<a term in the source>' | |||
``` | |||
|
|||
## Remove sensitive data from history, after a push | |||
```sh | |||
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <path-to-your-file>' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force
push...can you elaborate, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force
is there as the command should verify the overwrite of existing remote data. see this post on github help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what force
dose, but we can't avoid it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purpose of this command is to be destructive to the history. why would we want to avoid it?
is there anything inherently wrong with using force
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing wrong was looking for alternatives, we get this in, for now, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright 👍
as usual, thanx for the merge, i really love (contributing to) this project ❤️
add a tip to remove sensitive data from history (after a push)
No description provided.