Finally, the problem of "saving the user name and password on the GIT Windows client" is solved.

Source: Internet
Author: User

Since the GIT server was built with bonobo git server last timeSource codeSwitch the management tool from SVN to git.

The legendary git is indeed well-known: it is fast and can be split if you want it (convenient branch management )...

However, there is a bad thing: every time you use pull or push, you have to enter the user name and password, and you cannot save the user name and password.

ProgramOne of the members' nature-hate repetition (hate) and programmer's nature-solving problems (love ), the combination of love and hate can spark off-concentrate on finding a solution (quiet ).

Preparations:

1. Stay away from Weibo (the most distracting thing is not Weibo ).

2. Determine the route. The route for this problem is obvious. You must start with the server and client respectively.

Start to work:

1. Download bonobo git Server Source from the server firstCodeLet's take a look at 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, see:

Although GoogleArticleIt is for Linux, but it is not easy to think that the problem is in windows. I will 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 %, for example:

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

Solve the problem, git is more powerful!

Related Article

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.