git的基本使用
拉取并merge代码
git pull
添加暂存区
get add .
提交到本地仓库并加上注释
get commit -m ''
往远程仓库推送代码
git push origin master
多人协作方式
- 分支的构建
- 查看所有的分支
git branch -a
- 创建新的分支
git checkout -b aaa
- 切换到aaa分支
git checkout aaa
- 推送aaa分支到远程仓库aaa分支
git push origin aaa
- 本地添加一个远程仓库
git remote add origin https://github.com/xxx/xxx.git
- 将本地的master和远程添加的master进行连接
git push origin master:master同之前
- 克隆到本地
git clone xxx(地址)
- 拉取远程的文件(另一个人写了传了,你想搞下来)
git pull origin master
- 推送master到远程的aaa分支
git push origin master:aaa
- 删除一个分支
git branch -d xxx