我在github上发布了一些代码但是偶然发布了一些密码而且我更改了它们但它仍然在提交部分中看到。
我怎么能隐藏这个提交?
清除差异的唯一方法是用力推动。如果有多个人在同一个分支上工作,你最好让他们知道你正在重写历史。
假设这是你的最后一次承诺......
git reset --soft HEAD~
(undo password changes)
git diff
(make sure there are no changes that display the passwords)
(stage/commit changes)
git push origin +branch_name
遵循标准的安全预防措施,如果密码与敏感数据相关联,我也会重置这些密码...