git installation and basic usage

Source: Internet
Author: User
Tags using git

Get ready:

git software, GitHub account.

Git install:

Direct Baidu search git download, Windows and Mac different platforms. The official web is slow or not at all.

The default configuration is installed.

GitHub

Website: https://github.com

1. Apply for an account.

2. Add a repository to put your code in. There is a plus sign at the top right corner of the home page, click on the new repository, you can create a warehouse, if it is a new warehouse, not migrated, check initialize this repository with a README.

Using git:

The goal is to write code locally, manage local code with GIT, communicate with GitHub, and sync local code to GitHub.

First configure your own username, mailbox, is the local git configuration, can be different from GitHub information.

The next generation of your unique public and private key is to generate a pair of passwords, the public key you want to upload to GitHub, and every time you communicate with your github you need to verify your private key.

There's a unique matrix image behind it ...

Add SSH on GitHub, which is to upload the public key to GitHub.

To enter the Sshkey can be seen by the following command, copy and paste the table on the page above.

The next command is to see if the SSH pairing is successful, and then we can execute Git clone to clone the empty repository above the GitHub remote repository to local. The address at the back of clone is the address of your warehouse, which can be found in the lower right corner of the GitHub warehouse page.

Here we create a new CPP document, put it in the currently synced Lintcode folder, this time to view the Git status (Git status) found that the file has not been track, it can be through git Add. , git commit, git push three command synchronizes the local repository to the remote repository. After executing a git commit, use the VIM command to write the commit message: Press the I key first, enter the editing state, after writing the message, press ESC to exit the edit state, and then press: Wq to hold and exit.

When we're done, we'll open our own github and discover that our new CPP document has been synced to the remote repository.

git installation and basic usage

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.