GitHub How to create a new warehouse and submit code

Source: Internet
Author: User
Tags git client

Register your account with https://github.com/and remember your username and password. This step is slightly. Here's how to create a new warehouse and commit code.

First, a new warehouse in GitHub

    1. First go to your own homepage https://github.com/your_username

Replace the "your_username" above with your username.

As shown above, on this page you can find the "repositories" button, click on the button, the following page appears:

2. Click on the "New" button to appear:

The red part of the

is my user name, and everyone's affirmation is different. The others must be filled with Repository name description You can briefly describe the role of this warehouse and related instructions and so on. In general, we choose Span style= "FONT-FAMILY:CALIBRI;" > "Private" is chargeable. The following " Add a license " Represents the open source agreement to follow.

Here I name the warehouse named:azure-linux-automation, which is used to test Linux cases on Azure. In order to Clone the repository immediately to my local computer, this check box "Initialize this repository with a README" is selected here. . Finally, the content that I filled in is as follows:

3. After entering the above required content, click "Create Repository", the result is as follows:

This completes the new warehouse. You can see that there is a "readme.md" file in the Repository . In the following operation, we copy the Repository to our local computer. In order to implement copy / clone (clone) operation, we need to remember the address in the "HTTPS clone URL" (the part marked in red). My address here is:https://github.com/xian123/azure-linux-automation.git

Second, upload the project to GitHub

(1) First, you need to install a Git client on your computer . git is a free, open source version control software. Install git on windows, typically Msysgit, officially: http://code.google.com/p/msysgit/downloads/list

Install slightly. Description: The following actions are performed on Windows.

(2) Start Menu "Run" -- "cmd", enter. This allows us to perform the subsequent operation through the command-line mode.

(3) execute "git clone https://github.com/xian123/azure-linux-automation.git", here's "https://github.com/ Xian123/azure-linux-automation.git " is the address in the HTTPS clone URL . "clone" here means to copy the corresponding repository from GitHub ( remote ) to your local computer.

When the command executes, the remote Repository is copied to the local computer. Now look at the computer's directory (here i am C:\User ...), and the azure-linux-automation folder (the name of this folder and GitHub New warehouse name), enter the folder to see the readme.md file on GitHub . The commands executed are "CD azure-linux-automation" and "dir/b".

(4) Next, copy the code that you want to submit (upload) to GitHub to the Azure-linux-automation folder on your local computer , and then execute "git Add." command. Here's the "." represents the addition of folders and files for all changes in the current directory to the version manager. Note in step (3) , we executed the "CD azure-linux-automation" command , So the current directory here is azure-linux-automation.

(5) Execute git commit-m "First commit" command, submitted to the local version control library, quotation marks are your instructions for this submission.

(6) Finally, execute the "Git Push Origin master" command to submit the local repository to a remote GitHub, where the registered user name and password are used. The default is no prompt when entering the password.

Once you've done this, refresh your GitHub page to see the submitted / uploaded code as follows:

GitHub How to create a new warehouse and submit code

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.