Install Git
The first step: Check whether the git installation
Git input terminal, shown below are already installed, you can skip step, direct configuration Github
Step two : Install git
sudo add-apt-repository ppa: git-core / ppa
sudo apt install git
Step Three: Verify that the installation is complete
In the input terminal or git-version git
Configuration GitHub
Provided that there github account, if not registered, click https://github.com/ register an account
git config --global user.name "your github username"
git config --global user.email "github your email address."
开始使用
GitHub
Step One: Create a local warehouse
For example: New local repository called Mytest in the Documents folder, switch to the first position Ducument directory
cd Documents
mkdir Mytest
The second step:
切换到Mytest目录下,初始化本地仓库Mytest
cd ~/Document/Mytest
git init
third step:对本地仓库进行更改(任意修改)
比如,添加
Readme
文件
touch Readme
the fourth step:提交更改
git add Readme
git
commit
-m
'add readme file'
连接
github
仓库
git remote
add
origin https://github
.com
/
你的
github
用户名
/
你的
github
仓库.git
git
push
origin master
clone github
已有内容到本地仓库
git
clone
https:
//github.com/
你的
github
用户名
/github
仓库名
.git
更改
clone
过来的仓库
例如,添加一个新的文件
touch Readme_new
依然需要提交更改
git add Readme_new
git commit -m
'add
new
readme
file
'