Window sets TortoiseGit to connect to git without entering the user name and password each time

Source: Internet
Author: User

Method 1

After you have configured git, there is one in the C: \ Documents Ents and Settings \ Administrator \ directory. the gitconfig file contains the name and email you previously configured. You only need to add a line below.

[Credential]
Helper = store

The next time you enter the user name and password, git will remember to form a file in the C: \ Documents Ents and Settings \ Administrator \ directory. the git-credentials file contains your username and password (note: plaintext storage !!!).

In this way, you do not need to enter the user name and password when you try again later!

There are also methods to directly write the user name and password in the url on the Internet, for example:
Http: // yourname: password@git.oschina.net/name/project. git, tested, is not feasible.

Method 2

1. Download the source code of Bonobo Git Server from the Server to see how the Server verifies it.

There is an answer in web. config. The original answer is http basic authentication.


<Location path = "Git. aspx">
<System. web>
<Authorization>
<Allow users = "? "/>
</Authorization>
</System. web>
</Location>

With this answer, you can talk to the server about 88 and put it into the client's arms...

2. The client uses msysgit + TortoiseGit. TortoiseGit is only the shell, and msysgit is the truth.

The pull and push operations call the git pull and git push commands in msysgit, but the git command does not pass the parameters of the user name and password.

What should I do ?... Ask Google Bei, to speak to Google should be refined, not trembling, I said: "git username password"; or Google is awesome, the last line on page 1st provides a clue-Setup a remote git repository using http with push support and digest auth, as shown in the figure below:

Although Google's article is intended for Linux, do not consider the problem as a problem in Windows. You may not take a look at the solution in Linux. It is difficult to find the answer directly. In more cases, we are looking for clues and constantly thinking about possible solutions in the clues we discover.

Here, ". netrc" is the clue, which continues to say to Google: "git netrc windows "...

There are 1st "Stack Overflow" on 5th pages:

Git-How to use netrc file on windows-Stack Overflow

Google's plus 1 is not as powerful as the brand. When we see Stack Overflow, we can see hope and the impulse to click.

Click here to see the feeling of "Baidu" (abbreviated as "search for her in the crowd:

This is the correct answer. We have already verified it. The solution is described in detail below:

1. Add a HOME environment variable in Windows with the value % USERPROFILE %, as shown in the following figure:

2. Open % Home % in "start" run "and create a file named" _ netrc.

3. Open the _ netrc file in Notepad, enter the Git server name, user name, and password, and save the file. Example:

Machine git.cnblogs.com
Login cnblogs_user
Password cnblogs_pwd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.