在指定目录进行如下操作
初始化后才能配置对应目录的参数
git init
配置用户名和邮箱(config为全局配置)
git config --global user.name "your_name"
git config --global user.email "your_email@example.com"
创建SSH KEY
ssh-keygen -t rsa -C "your_email@example.com"
添加文件到版本库
#添加指定文件
git add README.me
#把当前目录下所有文件添加到版本库
git add .
提交描述
git commit -m "提交的描述信息"
指定本地库与github上的哪个项目相连
git remote add origin git@github.com:ellocc/gittest.git
本地库提交到github上
git push -u origin master
将github上的项目下载下来。
git clone -b master git@github.com:ellocc/gittest.git
从远程获取最新版本并merge到本地,-r rebas
git pull origin master -r
从远程获取分支并本地创建关联
git checkout -t origin/master
查看远程分支
git branch -va
http://blog.csdn.net/hudashi/article/details/7664457
http://www.ruanyifeng.com/blog/2014/06/git_remote.html