Submit code to GitHub via Git (Windows system)

Source: Internet
Author: User

1. New Project

Select and create a project on GitHub. First, sign in to GitHub, click the plus "+" in the upper right corner of the page, and select the "New repository" option.

Fill in the project name and description, default item is "Public", if you want to create "Private" project, GitHub will charge. Finally click "Create Repository" to complete the project creation

When a project is successfully created, GitHub gives you 3 ways to commit your code

2. Submit your code

Initialize the configuration first: Set the user name and email address of the warehouse personnel, this step is necessary

git config--global user.name "username"

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

Create a "testreport" project locally, consistent with the project name created on GitHub.

Create a test.py file under Project

Thegit init command is used to initialize the current directory so that the current Testreport directory is managed by Git.

the "Git status" command is used to view the status of all files under the current project.

We can see that currently in the Master branch, listing the current directory of the file (test_case.py), and the current directory is not tracking files (tracking file increase, deletion, change the status), and tell us that we can through "git add" command to trace a file

the git add command allows you to add traces to the specified file. If followed by a space dot ".", it means that all files in the current directory are tracked.

Check the current Git repository information again through the git status command.

git commit command submits files (files managed by git add) to the local repository. -mparameters to describe the present submission. Generally submitted descriptions are essential to facilitate traceability of changes made to each submission

.

    • "Git remote add origin [email protected]:github user name/testreport.git"

If you are submitting your project for the first time, this sentence is very important, and it will establish a connection between the local project and the remote repository. Here choose the SSH protocol mode to connect.

    • "Git push-u Origin master"

Submit a local project to the remote repository

3. View the submitted code via GitHub

Now visit GitHub to see the projects we've submitted, as shown in

Submit code to GitHub via Git (Windows system)

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.