Closed saviomartin closed 4 years ago
hey @tasnimzotder, @saviomartin has accidentally put his phone number into his commit, is there any way to wipe that out?
https://stackoverflow.com/questions/36168839/how-to-remove-commits-from-a-pull-request
# Checkout the desired branch
git checkout <branch>
# Undo the desired commit
git revert <commit>
# Update the remote with the undo of the code
git push origin <branch>
@saviomartin, try 👆 one time
@tasnimzotder, I didn't get what you said. I am not good at using git. And I am having trouble using it. Help me
@tasnimzotder What should I do next
@saviomartin Do you have git
installed and configured on your local system?
It is installed and configured. But I didn't know to use it properly. Once I used it didn't work well. How can I do it in the browser?
Actually I didn't get what the problem is?
@tasnimzotder unfortunately in this situation revert
is not a good option because it will create a new commit with the opposite changes - this is usually very good for keeping the history and usually the preferred option. However, in this case I think it would be better to rewrite history and remove the sensitive information from the history.
Now there is a new commit with the number taken out but the history still contains the sensitive information.
@saviomartin I recommend undoing both commits and creating a new commit without the sensitive information - you will have to force push
though, which is usually not recommended but as it is only you working in this branch it is not a problem.
These steps can fix it, but you will have to use the git cli, check you are happy with the git log
before you push, because if you make a mistake it is easier to fix without pushing.
git log
the last 2 commits are yours as it can remove other peoples commits)
git reset --soft HEAD~2
git commit -m " ... MESSAGE ..." python/SendWhatsappMessage.py
git push -f origin send-whatsapp-message
I hope that helps 🤓
@saviomartin you might be able to do it in the browser, if you delete the PR and branch, then re-create it all again - I am not sure if GitHub still tries to keep the history though. So a force push would be better although it must be done on the command line
Thanks, @eddiejaoude . I will close this Pull Request and open it again.
I will close this Pull Request and open it again.
Notice I did reply with I am not sure if GitHub still tries to keep the history though
, so do check this, I think force
push would be safer but a bit more work for you - the git CLI is something you will have to do eventually anyway
@eddiejaoude Thank you for your help. It helped me to get the thing. I'll contact @saviomartin and try to work this out.
@tasnimzotder no problem 🤓 . Any questions let me know
PS. @saviomartin I think the PR will stay even after deleting the branch + fork, and I don't think @tasnimzotder (the admin/maintainer) can delete the PR but only close it. Force push to this branch might be the best option.
Another way to force push to this branch/PR without undoing the previous commits...
git branch -D <BRANCH-NAME>
git checkout -b <BRANCH-NAME>
git commit -m " ... MESSAGE ... " python/SendWhatsappMessage.py
git push -f origin <BRANCH-NAME>
This will override the changes in this branch.
I have implemented a python code that uses pywhatkit module to send WhatsApp messages.
This is how it Works.
pip install pywhatkit
import pywhatkit
It is my first hacktober.
Thank you Savio Martin