Getting started with the GitHub site

Source: Internet
Author: User
Tags hosting asymmetric encryption

GitHub Basic Introduction, you need to master some of the SSH asymmetric encryption knowledge and some basic git command operation. Here are two of the better sites I recommend, and then I'll go through the steps to use the GitHub site.

git command: http://blog.csdn.net/dengsilinming/article/details/8000622 This website blog although I did not write, but very valuable reference.

The basic principle of SSH asymmetric encryption is introduced: In my personal words, the two sides have their own public and private keys, the public key set of the password only their corresponding private key can be solved. Therefore, asymmetric encryption is the communication between the two parties first agreed to exchange the public key, and then set the password, Then the password can be swapped with each other to be able to use their own private key to untie, since then agreed. The principle of SSH is the principle of non-symmetric encryption.

Here is a formal introduction to the use of the GitHub website:

a . SSH access to public and private keys :

$ ssh-keygen–t RSA then the resulting file path is as follows :

two. Set the generated public key on GitHub (where one of the public keys is exchanged):

Three. Then create a new warehouse and copy the SSH for the warehouse (this implies the exchange of the public key of the other party, and the public key exchange is complete):

Four. In the console input (copy the file of the warehouse and exchange the public key):

$ git clone [email protected]: Hl8023/text1.git

Five. You can then add a new file to the response file and enter the following command to implement Git hosting,

Enter a command to create a new file in the folder first touch Text1.txt

Six. But the above just implements the git hosting of the local repository, we need to synchronize to the remote repository, when the command is entered:

(You can enter Git remove–v to see the remote path.)

Seven. Note that if you open a managed folder in Webstorm, a cache file may be generated automatically. idea/, at this point we need to ignore this file, you can create a. Gitignore files, then enter the. idea/* in the file:

Then repeat Step five , step six to update the local repository git and synchronize the remote repository, but at this point the above command may not take effect because the. Idea has already been added, so there is no effect, you need to delete the local buffer, And then submit again to have the effect, at this time need to enter the following command to clear the cache:

$ git rm-r--cached . ( Note at the end do not forget the point )

Finally, repeat steps five and step six to achieve synchronization local and remote.

Eight. Create a branch and switch branches to create a file in a new branch

Nine. Push the local branch to the remote repository:

10. will developer text created in branch 2 ( login.html instead of demo) Merge to Master in the branch

Mode 1: operate online in the remote repository, then pull to Local.

Merge succeeded:

To view the merged files:

Mode 2: merge with the local repository

11. Delete Developer branches, only in master Branch to delete, not in developer . on the delete itself

To delete a local branch:

To delete a remote branch synchronously:

12. definition version ( local warehouse definition version and Synchronous Remote repository version)

Definition version succeeded:

13. Delete version ( Delete local and synchronous remote)

Delete succeeded:

14. above is clone from remote repository. to a local operation, first create a project locally, then the first step is to push the local project directly to the remote repository:

1. First create a library inside the remote repository and create a library to copy the SSH address later.

2. Associating local warehouses and remote warehouses

$ git Remote add origin + SSH address above

3. Push the local project to the remote repository:

$ Git push–u Origin master (plus-u if there is no content in the repository, you can omit it after you have the content)

4. Note that if the local repository does not initially have a Readme file, add the following code:

$ Git pull–rebase Origin master (which says so many origin, in fact refers to the name of the remote repository)

xv. Multi-person development Create an organization (you must first create an organization)

1 creating warehouses in your organization

2 Modify a project that already exists, clone to local first

3 One of the users adds content

4 is a multi-person development, to invite others (the main developer invites others to participate together)

5 Invitees Accept Invitations

Getting started with the GitHub site

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.