Linux use git and GitHub


As a developer, at work you must often use git and github, git as to what is, what is the github, in order to save time we will not repeat them here (which describes both the functional role of many articles on CSDN). This article simply demonstrates how to use git and github, so that people new to the fast start with how to use git.
As used herein, the platform is installed on a virtual machine Ubuntu, git into the use of Linux and Windows platforms on both platforms use the same basic git, git therefore only describes the use of the Linux platform.

First, the installation and configuration git git in Ubuntu

Installation tutorial
did not talk much direct open dry, install a good tool.

1, install git

The following three inputs according to the order command to complete installation:

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install git

After the installation is complete, you can view the version number of git has to determine whether the installation is complete, enter the following command:

git --version

If the version number can be found, it said the installation is complete, otherwise ... Baidu solve it.

2, configure the user name and mailbox

Before using git user name must be easy to use and configure the mailbox as identification, or can not use, configuration commands are as follows:

git config --global user.name "cdyaizj"
git config --global user.email "[email protected]"

Username taken at random, but mailbox mailbox must be binding on github, or can not download things from github.
You can enter the following command to check whether a good user name and E-mail:

git config --list

3, generates a key

This step is to contact git and github, git generates a key, the generated key is bound to github. In fact, the key is a string of serial numbers, English letters and numbers.
Enter the following command to generate the key:

ssh-keygen

Generated key in the user directory, the path is: ~ / .ssh /, there id_rsa.pub files in this directory, copying the contents of all open files after cat.
Entering GitHub, click settings -> SSH and GPG keys - > New SSH key, a new key, as shown below:
Key

Second, the combined use git and github

Released four original articles · won praise 1 · views 178

Guess you like

Origin blog.csdn.net/qq_39619643/article/details/104033814