Introduction: Git is a very popular version management tool, based on the client git a lot of, such as tortoise git, Smart git, etc., many times, we still have to be based on the command line for GIT operations, each need to enter a username and password, very inconvenient, How to do the pull and push operation without entering a username and password?
1. Under the LINUX/MAC system
Create a new ~/.netrc file, and record the GIT server, username, and password in this file as follows:
Machine your-git-server
login your-username
password Your-password
If there are more than one server to repeat the above three lines, enter the corresponding server, user name and password can be;
~ Indicates the directory of the head of household, if your username is Wangwu, then the corresponding directory is/USERS/WANGWU.
2. Windows
2. Windows System
On the Windows platform, a little bit of trouble, but also can be implemented, you need to add a user variable%home%, as follows:
Next, create a new file named _netrc in the directory that the%home% variable points to, as shown above, and record the GIT server, username, and password in this file as follows:
Machine your-git-server
login your-username
password Your-password
With the Netrc file, you don't have to enter your username and password when you use Git. 3. Eclipse settings
Configured under the preference--> git--> configuration:
User name and password can also be entered automatically here.