How to use Git to upload code to GitHub Remote server under Window

Source: Internet
Author: User
Tags git client how to use git

Register your account and create a warehouse

First you have to have a GitHub account, no self-registration, after the successful login should be like this

Select "+" on the user menu at the top of the page->new repository create a new warehouse

To get a name for the warehouse, click the Create Warehouse button and you will be able to create a warehouse successfully.

Installing the GIT client

GitHub is a server, and we need a git client to use git on our own computer.
Windows users please download http://msysgit.github.com/
All the way next, after the installation succeeds, go back to the C drive, or any folder, click the right mouse button will be a few more menus
such as Git Bash here, git Gui here, indicates the installation was successful.

Configure Git

Let's find a place in the computer's hard drive to store the local warehouse, for example, we set up the local repository under the C:\Users\7R4JZ52\.m2\git_repository folder
To enter the Git_repository folder, right-click the following steps:
1) Right-click Git Bash here in the local repository to execute GIT version (view this tutorial version)

version


Executing git init will come up with a. git hidden folder, which indicates that local git was created successfully.

$ git init

To upload a local repository to GitHub, you need to configure SSH key.
2) Create an SSH key locally

$ ssh-keygen -t rsa -C "[email protected]"

The following [email protected] changed to your mailbox.
To enter directly, the instructions will generate SSH key on the default file Id_rsa.
Then the system asks for a password, directly press ENTER to indicate no password.
Repeat the password is also a direct carriage return, after prompting you shh key has been generated successfully.


Then we go to the prompt address to view the SSH key file. The address of my computer is C:\Users\7R4JZ52\.ssh (see).


Open the Id_rsa.pub and copy the key inside. The key inside is a pair of characters that can not understand the combination of numbers, do not control it, directly copied.

Go back to the GitHub website, go to account Settings, and choose SSH keys,add ssh Key on the left.



New SSH Key
Title fill, paste key.

3) Verify success, enter in Git bash

$ ssh -T git@github.com

4) The next thing we need to do is to upload the local repository to GitHub, and we'll have to set up username and email before that, because GitHub will record them every time it commits.

$ git config --global user.name "your name"$ git config --global user.email "[email protected]"
Submit Upload

Create a new readme.md file locally

add README.mdgit commit -m "first commit"git remote add origin https://github.com/youproaddress.gitgit push -u origin master


Enter User name password



Success.

Transferred from:1190000004587329

How to use Git to upload code to GitHub Remote server under window (GO)

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.