github
https://github.com/geeeeeeeeek/git-recipes
github的使用
一、注册github账号。
请自行进入https://github.com进行注册。
二、安装git及一些基本设置。
1.安装git
- sudo apt-get install git
2.设置github账号信息
- git config --global user.name "your name here"
- git config --global user.email "your email@example.com"
这里“your name here”输入的是你注册github的用户名,这一步是设置你提交时,默认的用户名。
类似的,“your email@example.com”是你注册github账号的邮箱,也可以用别的邮箱,不过用别的邮箱时,需要在github主页上设置里面把用的邮箱添加进去。
3.设置让credential helper 帮助我们在一定时间内在内存中保存我们的code,其中第二行为设置超时的时间
- git config --global credential.helper cache
- git config --global credential.helper 'cache --timeout=3600'
三、建立新的repository
https://github.com/new
四、针对一个新建立的repository的操作(已有项目,跳过此小节,直接看第五节)
1.先建立一个目录,该目录与你新建的repos有关
- mkdir ~/test_project
- cd ~/test_project
- git in