tasnimzotder / hacktoberfest-2020

Let's tackle the Climate-Change together with Open-Source 🌍 + 👩‍💻
https://tasnimzotder.github.io/hacktoberfest-2020/
MIT License
24 stars 140 forks source link

Send Whatsapp Message Using Python #24

Closed saviomartin closed 4 years ago

saviomartin commented 4 years ago

I have implemented a python code that uses pywhatkit module to send WhatsApp messages.

This is how it Works.

It is my first hacktober.

Thank you Savio Martin

rokibulislaam commented 4 years ago

hey @tasnimzotder, @saviomartin has accidentally put his phone number into his commit, is there any way to wipe that out?

tasnimzotder commented 4 years ago

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

saviomartin commented 4 years ago

@tasnimzotder, I didn't get what you said. I am not good at using git. And I am having trouble using it. Help me

saviomartin commented 4 years ago

@tasnimzotder What should I do next

tasnimzotder commented 4 years ago

@saviomartin Do you have git installed and configured on your local system?

saviomartin commented 4 years ago

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?

saviomartin commented 4 years ago

Actually I didn't get what the problem is?

eddiejaoude commented 4 years ago

@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.

  1. Remove the last 2 commits (check with git log the last 2 commits are yours as it can remove other peoples commits)
    git reset --soft HEAD~2
  2. Check the code, it should not have the sensitive information due to the 2nd commit, but double check this, then commit your code again as usual with
    git commit -m " ... MESSAGE ..." python/SendWhatsappMessage.py
  3. Check the logs, you should now see your 2 commits from before gone and should see your single new commit
  4. Push the changes with
    git push -f origin send-whatsapp-message

I hope that helps 🤓

eddiejaoude commented 4 years ago

@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

saviomartin commented 4 years ago

Thanks, @eddiejaoude . I will close this Pull Request and open it again.

eddiejaoude commented 4 years ago

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

tasnimzotder commented 4 years ago

@eddiejaoude Thank you for your help. It helped me to get the thing. I'll contact @saviomartin and try to work this out.

eddiejaoude commented 4 years ago

@tasnimzotder no problem 🤓 . Any questions let me know

eddiejaoude commented 4 years ago

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...

  1. Delete the branch locally with git branch -D <BRANCH-NAME>
  2. Create a new branch with the same name as before git checkout -b <BRANCH-NAME>
  3. Make changes again locally
  4. Commit changes locally git commit -m " ... MESSAGE ... " python/SendWhatsappMessage.py
  5. Then force push git push -f origin <BRANCH-NAME>

This will override the changes in this branch.