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. -m
parameters 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)