Git的基本用法
- 初始化本地仓库
$ git init
- 使用别人仓库
$ git clone http://别人的项目地址
本地文件提交到服务器
- 添加到本地缓存
$ git add .
指所有文件添加$ git add 文件名
指单个文件上传
- 提交到本地仓库
$ git commit -m"提交描述"
- 提交到服务器
$ git push
- 添加到本地缓存
同步服务器内容
$ git pull
切换主分支
ls
$ git checkout dev
切换分支$ git checkout master
切换主干
合并
$ git checkout master
切换主干$ git merge dev
把要合并的分支进行合并$ git push
查看本地git的name和email
cat ~/.gitconfig
修改git的配置后的name和email
git config --global user.name "your name"
git config --global user.email "youremail@google.com"