linux--configuration using GitHub

Source: Internet
Author: User

The GitHub environment was configured under Windows a while ago, referring to the article "Tortoisegit connection github.com", now learning to program under Linux, finding some information on the web, configuring the use of GitHub under Linux, and documenting the process:

1. Installation

1, 1 installed with Yum

Command: $ yum install git Git-gui

1, 2 generate a key pair, using the Ssh-keygen method

The specific generation method refers to the "Use Ssh-keygen survival key Pair" article

1, 3 Copy the generated public key to the Sshkey in github.com

If the resulting Ssh-key error is not valid, change the contents of the public key to a row of rows, and be careful not to copy the spaces, line breaks, etc.

Pay special attention to the first character and don't miss it.


2. Testing

After adding the key, we tested to be able to link to GitHub.

Command: $ SSH [email protected]

See if any of these things appear:


3. Setting

In order to contact, you can fill in some of your information

Command: $ git config--global user.name "your name"

$ git config--global user.email "your email"


4. Cloning

Assuming that the project has been built on top of github.com, we'll call it a remote repository, ready to download:

Command: $ git clone [email protected]:alex-my/std.git

     

a project called "STD" is downloaded here.


       5, local library new files to remote warehouse

Create a folder locally, act as a local repository, then create a new file, and then upload the file to the remote repository.

Because there are already files on top of the remote repository, we need to update the files with pull first and then upload our new files to the remote repository.

     

     first establish a folder named "Std", not necessarily the same name as the project on github.com, initialize with git init

Create a file Vv.h, use the shell redirection to write some content, of course, these work can use VIM instead.

For convenience, use git remote to add a path alias so that you don't have to hit that long path.

Then, use Git pull Origin master to update the remote repository.

After viewing, two more files were found, vector.h,readme.md. This is the addition of the front, you may only readme.md or other, of course, this is not the point.

Git status is for printing information and can omit this step. We can see "?? Vv.h ", indicates that a new Vv.h is not in the remote repository.


Use git add to Add the information we want to submit to the file in the index library.

Use git commit to submit the contents of the index library to the local repository.

Commit to the remote repository using git push.


6. Update files

Git commit-a-M "brief"

Add-A to all files that have been modified or deleted and managed by GIT are submitted to the local repository.

Git push Origin Master

This command updates the local repository to the remote repository, where Origin is an alias and can be overridden with a specific URL.

If there are no newly added files, you do not need to use the git add command

linux--configuration using 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.