#安装
sudo apt install git
Have to build an account on the GitHub website first.
#配置 your github.
git config--global user.name "Fanbrightup"//Is your user name in GitHub git config--global user.email "[Email protected]"
(You can skip these two steps and you can't use them now)
View configuration informationgit config--list
Edit configuration Information gedit ~/.gitconfig
#创建公钥
Ssh-keygen-c ' [email protected] '-t RSA
Will let you choose some location, in the prompt message when the direct return to the good, cover the original, enter three times it
This establishes the corresponding key file under the user directory ~/.ssh/
#上传公钥
In the Github.com interface, select the Settings with the downward arrow next to the Avatar in the top right corner, then select SSH and GPG keys and select New Add.
Title can be arbitrarily named (my ubuntu16.04), the content of Key is copied from the content of ~/.ssh/id_rsa.pub, after completion, you can use
ssh-v [email protected]
To test. See the following information to indicate that the validation was successful.
...
Exit Status 1
#git常规简单的使用git clone plus an address to select the SSH address, can be more convenient to save passwords, establish a local software warehouse
Commit files in git use git Add file name (newly added) or write in the Warehouse folder. That is, add all git commit-m "message to add"//will be linked with the file submitted, it is convenient for git push to submit to the remote git checkout filename can restore the locally deleted files
git use, in Ubuntu