1.查看远程仓库
git remote –v
2.添加源仓库地址为远程仓库
git remote add [name] [remote]
3.远程仓库重命名
git remote rename old new
4.克隆仓库
clone 单个master分支
1.git clone [repository] //默认clone的是master(单个)
一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一
clone 多个分支
1.git clone [repository]
2.cd xxxx… //切换到项目目录
3.git branch -a //列出所有分支名称如下: * 号表示当前分支
4.git checkout -b [1-1.hello] [origin/template] // 作用是checkout远程仓库origin的分支template,在本地起名为1-1.hello分支,并切换到本地的1-1.hello分支 (通俗的讲:创建1-1.hello并clone远程仓库的template分支)
5.提交内容到远程仓库
git push [remote] [branch]
6.版本回退
git push -f //强制推送本地分支到远程分支,实现远程分支的回滚
7.差异比较
8.状态查询
9.分支操作
10.分支合并&处理冲突