I cloned a git repository from my Github account to my PC.
I want to work with both my PC and laptop, but with one Github account.
When I try to push to or pull from Github using my PC, it requires username and password, but not when using the laptop!
I don't want to type my username and password every time I interact with origin. What I am missing here?
For the uninitiated who are confused by the previous answers, you can do:
git remote -v
which will respond something like
then you can run the command many other have suggested, but now you know yourname and yourrepo from above, so you can just cut and paste
yourname/yourrepo.git
from above intoHere's another option:
Instead of writing
You could write:
Obviously with most shells this will result in password getting cached in history, so keep that in mind.
Source: Set Up Git
The following command will save your password in memory for sometime.
(For git 1.7.10 or newer.)
What worked for me was to edit
.git/config
and useIt goes without saying that this is an insecure way of storing your password but there are environments/cases where this may not be a problem.
I just came across the same problem, and the simplest solution I found was to use SSH URL instead of HTTPS one:
And not this:
You can now validate with just the
SSH Key
instead of theusername
andpassword
.This is what worked for me:
Example: