安装git:
1 |
sudo apt-get install git |
生成ssh key:
1 |
ssh-keygen –t rsa –C “youremailaddress” |
将生成的key(~./ssh/id_rsa.pub)绑定到github中去
配置相关信息
1 2 |
$git config --global user.email "your email" $git config --global user.name "your name" |
从本地push项目(github上要有该项目名)
1 2 3 4 5 6 7 8 |
$ makdir ~/test $ cd ~/ test $ git init $ touch README $ git add README //向项目中添加文件 $ git commit -m ‘0001’ //提交说明 $ git remote add origin git@github.com:YourName/test.git $ git push origin master |
从github上pull项目
1 2 |
$git clone url $git pull test master //更新仓库项目 |