Teach you how to upload your work to github

origin

Why do you upload something you made to github?
In the increasingly fierce market competition in the software industry, during the interview, there are high-star open source projects on github, which is definitely a plus. At the same time, knowledge sharing is also a virtue. Why not do this kind of two-way benefit. The following will teach you how to upload your own project to github, so that you can stand out during the interview.

Steps to upload the project to github

A quick overview of the steps:

cd to the root directory of the local project
git init
git add .
git commit -m "commit instructions"
git remote add origin 'the warehouse address you created for this project on github'
git pull origin master
git push -u origin master -f

Step 1: Initialize the git repository

cd to your local root directory, execute git init, and create a git repository under your project.

Step 2: Add all files under the project to the git repository

Execute in the same directory as the previous step git add .. Don’t remind me, if you are afraid of git add .problems in this step, you can use it git statusfirst to check which files have been modified, and then add them separately to be safe, but it will be more troublesome, and it depends on personal habits here.

Step 3: Add the files in the cache area and commit to the local warehouse

Still in the directory just now, execute git commit -m "提交注释".
Console operation steps

Step 4: Create your own Repository on github

Only the local warehouse is definitely not enough. In this step, we will create a warehouse on github. The steps to create a warehouse on github are as follows:
Create a warehouse on github

Step 5: Associate the local warehouse to github

git remote add origin https://github.com/ningjianwen/ZhiHuDaily-RxSwift.git

Remember to replace the warehouse address above with your own warehouse address.

Step 6: Pull the following code on github before uploading the code

git pull origin master

Step 7: Push the code to github

git push -u origin master

After the execution, if there is no abnormality, wait until the execution is completed and the upload will be successful. You may be asked to enter Username and Password in the middle, and you only need to enter the github account and password .

Precautions

If an error similar to the one below is reported during the last step,
Reported an error

Don't panic, just follow the command in the seventh step with a parameter **-f**.

git push -u origin master -f

At this time, it will show that the project is being uploaded, and you can see your project on github after the upload is complete.

Reminder: Don’t forget to add your SSHkey on github , please Baidu for this.

Supongo que te gusta

Origin blog.csdn.net/u010389309/article/details/100335200
Recomendado
Clasificación