github安装使用

作者:Chris

1.安装

sudo apt-get install git
sudo apt-get install git-core

2.创建密钥加入github

ssh-keygen
cat .ssh/id_rsa.pub

进入这个页面https://github.com/settings/ssh把密钥复制到github

3.验证
pi@raspberrypi:~$ ssh git@github.com
PTY allocation request failed on channel 0
Hi koy1619! You’ve successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
pi@raspberrypi:~$

出现此提示即可使用github

4.github常用简单命令

<br /> git clone https://github.com/hugcoday/hugcoday.github.com.git koy1619.github.com #从github检出项目仓库<br /> git init #初始化仓库<br /> git add -A #添加新文件或者更改新文件<br /> git commit -m "add new blog" . #提交文件到本地<br /> git remote set-url origin git@github.com:koy1619/koy1619.github.com.git #查看repository上的所有分支<br /> git push -u origin master #push到服务器上

更多请访问 http://git.gitcafe.com/book/zh

您的评论

Build by Loppo 0.6.14