How to upload local projects to Github (super detailed)

1. Background.

A few days ago, I had time to write a complete project. It was not very complicated. I had time today, so I uploaded the project to github for everyone to learn and use. I just wrote a tutorial about uploading a local project to Github.

Second, the solution.

1: Premise.

    1.1 Register a Github account and complete the corresponding configuration of ssh. GitHub official website: https://github.com/

    1.2 Install the git tool, installation address: https://git-for-windows.github.io/

https://git-for-windows.github.io/

2: Enter the Github homepage, click New repository to create a new project.

 3: Fill in the corresponding information and click create.

Repository name: warehouse name

        Description (optional): Introduction to the warehouse description

        Public, Private : warehouse permissions (public sharing, private or designated collaborators)

        Initialize this repository with a README: Add a README.md

        gitignore: The type of warehouse that does not require version management, corresponding to the generated file .gitignore, optional

        license: certificate type, corresponding to the generated file LICENSE, optional

4: Click Code, clone the ssh address below, and use it later.

5: Next, go to the local operation. First, make sure that you have successfully installed the Git software. Find the project folder you want to upload to Github on your computer, enter the project folder, click the right mouse button, and select Git Bash Here, as shown in the figure below.

 6: Next, enter the following code (key step) to clone the warehouse on github to the local

git clone the address you copied above (replace with the address you copied before)

 7: After this step, there will be an additional folder under your local project folder. The folder name is the project name on your github. As shown in the figure, I have an additional smartcampus folder. Let’s put the local project folder All the files below are copied to the new extra folder

 

8: Enter the project, cd smartcampus, and execute the following commands in sequence.

 

git add .  (注:别忘记后面的 . ,此操作是把项目文件夹下面的文件都添加进来)

git commit  -m  "提交信息"  (注:“提交信息”里面换成你需要,如“first commit”)

git push -u origin main   (注:此操作目的是把本地仓库push到github上面,此步骤需要你输入帐号和密码)

 

 9: At this point, the local project code has been successfully uploaded to the remote Github warehouse, and you can see your own code by refreshing the Github homepage

3. Summary.

There is a lingering fragrance in the hand of giving away roses, and the article is regarded as my own notes. 

 

Guess you like

Origin blog.csdn.net/weixin_42188778/article/details/126533073