Download GitHub's Open source code on the Windows platform via git

Source: Internet
Author: User

Common instruction Collation:

(1) Check if SSH key already exists. Gitbash.

See if you already have an SSH key: cd ~/.ssh. Example shows that a key already exists

(2) Generate public and private keys

$ ssh-keygen-t rsa-c "[Email protected]"
Press 3 a return, the password is empty.

Your identification has been saved In/home/tekkub/.ssh/id_rsa.
Your public key has been saved in/home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
..................
Finally, two files were obtained: Id_rsa and Id_rsa.pub

in the GitHub Added on SSH Key , which is added to the "Id_rsa.pub" the public key inside

(3) Check if the link is on GitHub

$ SSH [email protected]

FAQ Finishing:

Issue 1: "Push" push local version to GitHub pops up with the following error message:

\ "D:/program Files (x86)/gitextensions/gitcredentialwinstore/git-credential-wins

Tore.exe\ "Get:-c:line 0:syntax error near unexpected token ' ('

\ "D:/program Files (x86)/gitextensions/gitcredentialwinstore/git-credential-wins

Tore.exe\ "Get:-c:line 0: ' \" D:/program Files (x86)/gitextensions/gitcredentia

Lwinstore/git-credential-winstore.exe\ "Get"

Workaround:

Locate the. gitconfig file, which, by default, is in the. gitconfig under C:\Users\ username \, which is opened with a text editor with one of the following configurations:

[Credential]

Helper =!\\\ "D:/program Files (x86)/gitextensions/gitcredentialwinstore/git-credential-winstore.exe\\\"

The escape character is modified to:

[Credential]

Helper =?! \ "D:/program Files (x86)/gitextensions/gitcredentialwinstore/git-credential-winstore.exe\"

question 2: git extensions and other Windows clients save git username password, every time in Git use https way pull or push code,

You must enter your username and password, Git Extensions the user name and password settings are not saved. This has brought great inconvenience to the use. To be able to

Enough to store the user name password, save each commit to enter the user name password cumbersome operation, need to make some settings.

Workaround:

1. Add a home environment variable to the environment variable in Windows, with a value of%userprofile%,

2. In the Windows Start menu run, enter%home%, open the user directory, and create a new file named "_netrc".

3. With the open _netrc file, enter the GIT server name, user name, and password. Formats such as:

?

4. Save the exit, restart Git Extensions, and then submit the code without entering the username password.

?

The installation configuration is as follows (we recommend using the Gitextension Chinese version) using the Gitextension and Git2.0window clients respectively, both of which can be downloaded and updated.

(1) Download GitHub's Open source code using Gitextension.

    • Git Extensions Installation configuration:

Re-install Tortoisegit :

    • GitHub Account Application

GitHub the Address ? https://github.com/

Fill in the account information, even if completed.

    • Configuring associations

1. Create a project testgit.

    • Setting the associated key

1) start, select your language.

2) To set up user information:

Save the above public key string and public key Key file is Public file, the key is private.ppk file.

    • Add the public key to GitHub's key Manager:

    • Get clone locally

after the configuration is complete, your Git already can with GitHub the above is synchronized.

Visual Studio the following menu appears:

?

(2) Download GitHub's open source code using git

    • Download the Windows version of the GIT toolkit.

: Https://git-scm.com/downloads

?

Note: You can also find the download package in the 360 software butler.

?

    • Install the Windows version of the GIT toolkit

?

After downloading, double-click to start the installation.

    1. Leave the default options and go directly to the next step. Note: The options here are mostly file associations and the like.

    1. Set in the System environment variable "path" and select the second one. Note: You can invoke the Git command by using the cmd command form.

    2. Choose Default (move out to Windows style, commit to Linux style). Note: This is primarily due to compatibility issues caused by inconsistent line breaks between the Windows operating system and the Linux operating system.

    3. Select the default option. Note: Git bash uses Windows cmd.exe.

      ?

      ?

    4. Select the default option.

      ?

?

    1. Go to the installation Progress screen, and when the installation is complete, close the Installation dialog box.

?

    • git configuration and SSH key generation

View git configuration directives: Git config-l

?

    1. Test the GIT system environment variable settings.

Open cmd to enter Git--version. Press ENTER, if a git version appears, then the second step in the setup process, in the system environment variable path, has been added to the git path. You can also manually add or navigate to the directory where Git is located by using the CD command.

D:\Program Files\git\cmd

    1. Set up user nicknames and mailboxes.

git config--global user.name "you name"

git config--global user.email [email protected]

Note: The user name and mailbox here are used in GitHub.

?

    1. Create an SSH key.

      Enter in git bash or cmd: ssh-keygen-t rsa-c "[email protected]"

Note: Here is the uppercase ' C '.

(1) Set the public RSA key (SSH keys) storage location, direct return to the default address: c:\users\username\.ssh\id_rsa.pub

? (2) Set a password and re-enter the confirmation (not recommended here, convenient for local use)

? (3) Public RSA key save path: C:\users\username\.ssh\id_rsa.pub

?

    • Add git-generated keys (SSH) to GitHub

?

    1. Open the Gitbub configuration page

?

  1. Add a new SSH key

    The first step:

    Step Two:

    Step Three:

    ?

  2. test the success of adding an SSH key to GitHub

    open git bash input: ssh? [email protected]?

    return: Hi mymhj! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.

    Prove added successfully.

    Note: The keys generated each time are different, and after you regenerate the keys, you need to GitHub re-added in the

    ?

    • 5 cloning a project from GitHub via Git

?

1. Create a new folder and right-click to select "Git GUI here"

2. Select "Clone existing Repository"

    1. Enter the repository address and save directory to be cloned

Download GitHub's open source code on the Windows platform via git

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.