This might be stupid question. But I could't find anything about this by search. Maybe, this is stupid question.
I've stored my codes in github.
2 hours ago, I want update my codes in repository, but my local doesn't have that code. So I cloned it, modified codes, and pushed it. At this time, git prompt me to type user name of github and password. I typed it and code updated.
After that, I read my codes in "OTHER" repository. And I found something needed to modify, too. So I cloned that repository to my local computer, modified codes, and pushed it.
But... at this time, git does not prompt message to input user name and password of github.
Huh? Is this mean that anyone cloned my codes in github could also push to my github repository? This is very dangerous situation, isn't it?
So I tested with creating new repository in github. I cloned this new repository to my local, made some change, and pushed it. But git does not prompt message to type user name and password, too.
So, my question is,
Below is my commands when doing above works.
$git init
$git clone https://github.com/[user name]/[repository name].git
<some change>
$git add *
$git commit -m "change"
$git remote add origin https://github.com/[user name]/[repository name].git
$git push origin master
Added information. For more details, I captured my github setting pages.
You can manually unset credential.helper by running below command.
git config --global --unset credential.helper
use --global
or --local
or --system
as per your needs.
Then pushing in github will ask for username and password.
If you are on windows one other way to do this is as below but note that it will again save your credentials if you use credential.helper with git.
Go to control panel
-> Credential Manager
-> Windows Credentials
and remove your git credential entry/entries.
For Mac users password can be clear by running below command :
git credential-osxkeychain erase
host=github.com
protocol=https
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With