I have two GitHub profiles. I created a repository using one and created a token through my IDE (PyCharm) and GitHub for the other account so that it can push commits. I had some successful pushes and merges from the other account which makes sense because I had provided a token.
Here is the unexpected part. As part of an experiment, I revoked all generated tokens on GitHub. After doing so, my other account was still able to push to the repo! Being very surprised by this result, I continued the experiment as follows: I ran git config user.email inside the local repo folder to update the email address to a nonsense email address that I'm pretty sure does not exist. Even after this change, I was still able to use git push to push changes to my remote on GitHub. That is, I can see the changes on GitHub. Any idea why that is? Two notes, just in case:
- During the entire experiment, I was using a single computer (my laptop). Could it be that the generated tokens are stored somewhere and are being used no matter what the current user email address is? Again, all the generated tokens are revoked on the remote (GitHub).
- There is only one branch,
master, on both my local and remote.