Github to use to do their own page on the web

This is a common front end for developers to learn how to use github to give herself an online page. The following required pre-prepared, some specific installation details in this article is not elaborated. Also herein, this system will be explained using windows.

1 installed git : whether it would like to use github, or other alternatives at home and abroad, this tool must be installed.

2 own a github account, if not register a bar.

3 just an editor, I am using VSCode , or WebStorm . Both are good, the other even if the bar.

4 local projects already have their own code. [In fact, this is nonsense :)]

 

let's start!

first step:

git features is actually a local warehouse and docking remote repository, as are the two destinations of long-distance freight. So open gitbash [cmd command interface can also be, that is slightly different command], you move to the next item corresponding directory, enter:

git init

In this case, you can see the right side of the directory will appear   (master)  words. Explain your project has been added to a local git repository, a branch named master.

 

Step two:

Let's create two git important files can be .gitignore not need to upload files or folders into the set, and the other is a markdown file, README.md. Directory schematically as follows:

 

 third step:

Create a remote repository (repository) on github, after logging There are two places you can create a new repository:

 

the fourth step:

Set the repository name, description and other information. Here in addition to the name, the other can not choose, you can directly create, as follows:

 

the fifth step:

Enter the command, so that the two warehouses link.

git status // look at the state of the local repository file, the effect is as follows:

 

You can see all the files are red, but that the file is not excluded .gitignore. Here is a description has not been added to the contents of the local repository! Then enter the command:

git add. // will add a red mark all files. . That is all. Results are as follows:

  

Erupted in green have become, in fact, here is a description of these files are marked ready to put in the warehouse, but still remain outside the warehouse. So also enter the command library:

git commit "commit content" -m // submitted to the local repository, and give some explanation, or enter the following command 
git commit -v // is different from the above, which will open the default editor, you can see submitted content in the past. But remember that you must close the editor again be considered a success join a local warehouse  

After the local repository to submit complete, and will need to dock the remote repository, enter the following command:

git remote add origin [email protected]: EddieJYan / ejy_portfolio.git // this is to take a local repository name origin, remote links to, git @ .... address specified remote repository 
git push -u origin master // push origin of the local repository to the remote master branch. After setting up these words in the future you can just type git push in the project directory.

Note: SSH keys can help you in the future in each commit not need to enter the account number and password, you can click on how to set  githubHelp  see. 

Ok, finally completed, let us look at github site, we upload the bar code, as shown:

 Step Six:

In fact, so far almost complete, it follows that our most anticipated moment, let github generate an address for us to showcase our page now! Continue on the map:

This address can be accessed directly, but note that the default access page is index.html in the project root directory, if you want to access other pages you need to enter the corresponding path, the same path to the default folder and file name. 

To sum up:

1 To use github requires an understanding of the fundamental Git usage and command line

2 If you are not good at entering commands in the console, then gitbash, windows users can also use at least cmd

The basic concept is that the 3 Git repository code sharing local and remote warehouse and interoperability

4 Use code hosting, at least need to bind SSH keys

5 here can only create static pages, but also because it is a foreign server, it is relatively slow. Because of that, you have to only show in the country, it is recommended also in the country to find a github alternatives.

 

If you have any other comments you can message me!

 

Guess you like

Origin www.cnblogs.com/strayhunter/p/11407840.html