I just learned some basic git operations yesterday, but unfortunately [email protected] announced that we should try to Use https for operations.
However, when using https for push, you must enter the account and password.
A variety of solutions have been found on the [email protected] official website of Baidu Google, "how to set a password using [email protected] in https mode"
Several methods are provided in this article, which are very simple.
I don't like the cache method very much, because it needs to be set and will expire.
The corresponding store is very convenient. After global settings, it is convenient for multiple databases to use.
Of course, if you have a database that does not use the account password, configure it separately.
Git config credential. helper store
In this way, remove -- Global to configure the user name and password for the current project.
Maybe the first time I used it, my friends didn't quite understand it. I didn't enter the account password clearly. How can I remember it?
In fact, after the configuration is complete, we need to push it once. This time we have to enter the account and password, but we do not need to enter the next push.
As for the finalUser name: PasswordI don't like it very much.
But I also tested it and found a small problem. I 'd like to share it with you.
Git remote add origin http: // yourname: [email protected]/name/Project. Git
This command is fine. But when we add the user name and password, the problem arises.
For example, the username is [email protected] And the password is @ 123456.
Then the address is changed to http ://[Email protected]:123456@ Git.oschina.net/name/project.git
Such an address is completely unavailable. We must encode the user name and password URL.
The User Name ABC % 40qq.com and password % 40123456 are available.
Of course, for jser, converting URLs or something is simple. Press F12 to open the console,
Enter encodeuricomponent ('[email protected]') to obtain the result.
The command behavior we finally get
Git remote add origin http: // ABC % 40qq.com: % [email protected]/name/Project. Git
In this way, we can directly push it without entering the user name ..
Well, today's sharing is all about it. I hope it will help you.