Using GitHub under Windows

Source: Internet
Author: User

1. First to github.com registered users;

2. Download git, Address: Http://pan.baidu.com/s/1skPpWlB (64-bit download); Http://pan.baidu.com/s/1skOAa77 (32-bit download)

3. Install by default;

4. The Start menu found "git", "Git Bash", pop up a similar command-line window, it shows that Git installation success;

5. Check if the computer has SSH key settings (SSH key provides a way to communicate with GitHub, in this way, to use GitHub as its own remote server for version control without entering a password):

$ cd ~/.ssh or cd. SSH

If not, prompt: No such file or directory

If any, enter the ~/.SSH path (LS View current path file, RM * Delete all files)

6. If there is no SSH key, you need to generate an SSH key:

$ cd ~ #保证当前路径在 "~" under

$ ssh-keygen-t rsa-c "[email protected]" #[email protected] for your own mailbox path

After creating SSH key, you are prompted as follows

Generating public/private RSA key pair.

Enter file in which to save the key (/C/USERS/XXXX_000/.SSH/ID_RSA): #不填直接回车

Enter passphrase (empty for no passphrase): #输入密码 (can be blank, indicates that no password is required, password is not visible during password entry, you need to keep your password in mind)

Enter same Passphrase again: #再次确认密码 (can be empty)

Your identification has been saved In/c/users/xxxx_000/.ssh/id_rsa. #生成的密钥 (the generated key is stored under C/users/xxxx_000/)

Your public key has been saved in/c/users/xxxx_000/.ssh/id_rsa.pub. #生成的公钥 (IBID.)

The key fingerprint is:

e3:51:33:xx:xx:xx:xx:xxx:61:28:83:e2:81 [email protected]

7. Add SSH key to GitHub:

Login Github--> Click on the Avatar drop-down box-select seething--> ssh and GPG keys-->new ssh key--> add title title--> paste the SSH key just generated (in C /users/xxxx_000/use Notepad to open the Id_rsa.pub file, copy the contents)-->add SSH key.

8. Configure your account:

$ git config--global user.name "your_username" #设置用户名

$ git config--global user.email "your_registered_github_email" #设置邮箱地址 (recommended for registered Giuhub mailboxes)

9. Test whether SSH keys is set successfully:

$ ssh-t [email protected]

The authenticity of host ' github.com (192.30.252.129) ' can ' t be established.

RSA key fingerprint is 16:27:xx:xx:xx:xx:xx:4d:eb:df:a6:48.

Is you sure want to continue connecting (yes/no)? Yes #确认你是否继续联系, enter Yes

warning:permanently added ' github.com,192.30.252.129 ' (RSA) to the list of known hosts.

Enter passphrase for key '/c/users/xxxx_000/.ssh/id_rsa ': #生成ssh Kye is the password is empty then there is no this, if the password is set to have this, and enter the password to generate SSH key can be set.

Hi xxx! You've successfully authenticated, but GitHub does not provide shell access. #出现词句话, the settings are successful.

10. Publish the project via SSH to GitHub:

Create a sample warehouse on GitHub:

Copy the SSH path to the warehouse:

To create a local project:

1. Create a directory:

$ mkdir testdir (TestDir folder located under C:\Users\xxxx_000)

$ cd TestDir (enter into the TestDir directory,$ pwd Displays the current directory)

Note: Another way: Create a new folder directly in the appropriate directory and right-click Git Bash here

2. Initialize:

$ git init

3. Create a Readme.md file (. MD represents MarkDown, a text-formatted file that adds some symbols to make the content of the article more hierarchical in typography. )

$ echo "This is a test of testing ssh key" > readme.md

Note: When you create a warehouse on GitHub, the readme.md file is often automatically generated and can be imported directly to the Local:git pull ' paste copy of the SSH path of test ssh key '

4. Submit to Local:

$ git Add. #提交当前目录下所以文件

$ git commit-m "add hello.md" #提交记录说明,add hello.md is a description of this operation

5. Submit to GitHub:

$ git Remote add origin ' paste copy test ssh key ssh path ' #从仓库复制下ssh路径

$ Git push-u Origin Master

Enter passphrase for key '/c/users/hgpin_000/.ssh/id_rsa ': #ssh key to set the password so you need to enter a password

At this point, the upload of the local project has been completed, and the new content is added to the GitHub refresh repository.

Using GitHub under Windows

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.