Beginner github

1. What is github? 

   Distributed Version Control System

 

2. What are the advantages of github over other version control systems?

   Distributed, everyone can make changes and then submit them to the core development team for review.

   Safe, no data loss due to host damage

 

3. How to use github?

  3.1 First go to https://github.com/ to  register an account, the URL of the detailed tutorial:

         http://www.linuxidc.com/Linux/2015-02/114121.htm

 

  3.2 Then download github and install, detailed tutorial URL:

        http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137396287703354d8c6c01c904c7d9ff056ae23da865a000

 

4. There is a full set of github tutorials on Liao Xuefeng's personal website

  Create a repository:

   

$ mkdir learngit
$ cd learngit
$ pwd

   Related commands:

                4.1 The pwd command is used to display the current directory

                4.2 git init is used to create a new repository

                4.3 git add xxx adds xxx to the repository

                4.4 git commit -m "xxx" commits the files in the warehouse to the warehouse

                4.5 git status View the current status of the warehouse

                4.6 git diff to view the modified content

                4.7 git log View all committed versions

                4.8 cat xxx displays xxx files

              

                4.9 version switch

                     git reset --hard head^ // go back to the previous version

                     git reset --hard version number //According to the version number, switch to the specified version

                  

               4.10 Push the files of the local warehouse to the github remote warehouse command: (To establish an association before, refer to 6)

                     git push origin master

 

               4.11 Clone the repository on github to the local, and the corresponding folder will appear locally after completion

                   Format $ git clone [email protected] : username/filename.git

                   Example $ git clone [email protected]:hesiyuan1994.com/test.git

5. github is a remote repository

As long as you register a GitHub account, you can get a Git remote repository for free

 

6. How to associate a local repository with a remote repository on github?

   Tutorial: http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013743858312764dca7ad6d0754f76aa562e3789478044000

 

                                                 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326964006&siteId=291194637