How to upload projects on Github

1. Configure account information

# 邮箱
git config --global user.email "YourEmailAddress"

# 账户名
git config --global user.name "YourName"

2. Create a new warehouse

clickNew repository

insert image description here

Enter the relevant information (the warehouse name is taken as myRepoan example), and then clickCreate repository

insert image description here

3. Initialization

Run in the root directory of the local project to generate local git management

git init

insert image description here

4. Add the files to be uploaded

If you want to upload all files in the current directory, run

git add .

insert image description here

5. Submit

The git commit command adds the content of the staging area to the local warehouse.

-mThe following content can be some remark information

git commit -m "first commit"

insert image description here

6. View submission status

You git statuscan view the submission status of the current warehouse with

git status

insert image description here

The above output shows that we have not made any changes since the last submission, which is a "working directory clean", which translates to a clean working directory.

7. Add remote repository

clicksettings

insert image description here

clickDeveloper settings

insert image description here

CreatePersonal access tokens

insert image description here

After ticking , repo、workflowetc. Generate token, click to complete the creation, and find a safe place to save the generated ones token. After closing this page, you will never see it again.

insert image description here

Add remote repository

git remote add origin https://[email protected]/yourName/myRepo.git
  • yourToken: the token just generated
  • yourName: account name
  • myRepo: warehouse name

Run git remote -vto view all remote warehouses
insert image description here

8. Upload project

Enter git push -u origin master, upload the code to the github warehouse

git push -u origin master

insert image description here

Check whether the project has been uploaded on github

insert image description here

success!

Guess you like

Origin blog.csdn.net/cacique111/article/details/126961222