Two minutes to learn how to host code in GitHub

This blog aims at children's shoes that can't GIT. Great gods can bypass them. Thank you for correcting the mistakes;

The power of GitHub is not explained here. We know that GitHub has been used for some time, but we have been struggling not to use it.

This article introduces how to host engineering code on it; If you haven't registered a GitHub account, please go to https://github.com/ Register on

If you have registered a GitHub account, you have installed GitHub on your computer and haven't uploaded the code yet

1. Open the browser to log in to your GitHub account, and create a new repo, as shown in the figure:

2. Then jump to the next page and fill in the repository name, such as test. In the add. Gitgore item, select according to the language you use, the other defaults, and then create repository

Then GitHub automatically generates a simple command line for hosting your project. The connection behind HTTP and SSH creates the remote warehouse address for you

3. Open Xcode to create a project, for example, the project name I created is testdemo, then open the terminal, enter the testdemo folder, and enter the command prompted by create a new repository on the command line

The project code has been managed;

When you enter git push - U origin master on the terminal, username: and password will appear to indicate your GitHub account and password. We will enter the account and password and display them blank all the time. This is to prevent the disclosure of users' privacy without displaying any information, not the phenomenon of computer brain fake death

4. Then you can find the testdemo code project you just handed in on the terminal in the repositories of your GitHub account: as shown in the figure

Open test, https://github.com/XFZLDXF/TEST.git It is the link of the code project, through which the contents of the project can be cloned locally

Explain the command entered:

1) The touch readme.md file is an introduction to the engineering code, similar to the user manual

2) Git init initializes a local git repository and generates a hidden. Git directory (the hidden. Git directory can be viewed using the LS - AF command)

3) Git add readme.md add the readme.md file to the repository

4) Git commit - M "first commit" executes the submission instructions, which are mandatory in gitz

5)git remote add origin https://github.com/XFZLDXF/TEST.git Add the local warehouse origin and specify the remote warehouse address

6) Git push origin master pushes the local warehouse to the remote specified master branch

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>