hash值 更改git_Git通过bitbucket中的哈希值提交删除(Git commit delete by hash number from bitbucket)...

Normally deleting a commit from a published branch is a bad idea, because it can cause problems for anyone else sharing that branch. But in this case, leaving your credit card number is probably worse.

If the commit containing the CC number is the HEAD of the branch, then you can amend the commit by editing that PHP file and then committing via:

git commit --amend

If the bad commit is not the HEAD of the branch, then you can try doing an interactive rebase via:

git rebase -i HEAD~10 # replace 10 with however far you need to go back

This will bring up a list of commits on your branch, oldest to newest. Find the commit containing the credit card, and change pick to edit for every commit from that point down the list. You need to remove that information from every commit since you first added it to the history.

Note that since you have rewritten the history of your branch, you will have to force push it to the remote using:

git push --force origin master

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值