Basic configuration and use of GitHub

Source: Internet
Author: User

First step: Try to create an SSH key

SSH-KEYGEN-T rsa-c [email protected]

The default is to generate Id_rsa and id_rsa.pub in the ~/.ssh directory.

-T represents the key type, common types are RSA1 (SSH-1) ,RSA (SSH-2),DSA (SSH-2), etc., and if not specified, the RSA key for SSH-2 is generated by default.

-C means to provide a new comment

The second step: in the background of github.com add ssh key,title write freely, copy the SSH text string by the following command:

Pbcopy < ~/.ssh/id_rsa.pub

Step three: Verify that the connection is valid

ssh-t [email protected]

the explanation for-T is Disable pseudo-tty allocation. do not occupy the shell. (" It is important to do SSH test connection with-t, because some server could abort the transaction entirely if a T Ext-terminal (TTY) is requested. ")

If this is the first time the connection will prompt for continue, enter Yes to see: You' ve successfully authenticated, and GitHub does not Provide shell access . This means that you have successfully connected to GitHub.

Fourth step: Building a new warehouse in github.com (Repository)

Follow the form to fill in the appropriate content. After the warehouse is established, the page will prompt some basic operation instructions:

Here are some common operations and points of note:

    • Get (Pull)
      $cd current directory $git init$git pull [email protected]:xxx/xxx.git
    • Submit (Push)

      $cd Current directory $git init$git Add.  or git add test.txt$git commit-m "First commit"$git remote add alias [email protected]:xxxxx/xxxxx.git$g It push alias Master
    • show Local branch when you enter "Git branch" (local branches)

      $ git branchdebianserver* Master
  • Show Remote Trace Branch (local branches) when you enter "Git branch-r"
    $ git branch-rcognac/masterfruitfly/serverorigin/albertorigin/Antorigin /contriborigin/cross-compile
  • Submit Multiple Files

    $git Add file1.txt$git add file2.txt$git add file3.txt$git commit   -M  "add 3 files. "
  • Submit after modifying a file
    " Modify File1 " $git push alias Master

    $git Commit-a-A is to turn Unstaged's file into staged (this does not include the new (untracked) file) and commit.  

Basic configuration and use of GitHub

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.