git 命令使用介绍

1.使用刚创建的分支

git pull

git checkout [branchname]

  

2.在分支上提交代码,合并

//提交代码
git add .
git commit -m ''
git push
//合并到master
git checkout master
git merge origin/[branchname]
git push

3.git checkout

git checkout . //本地所有修改的当前目录下的文件,没有的提交的,都返回到原来的状态
git checkout [filename] //恢复单个文件

git checkout branchname //切换分支名

4.查看所有分支

git branch

5.当前分支和某个(otherBranch)合并

git merge otherBranch

  

  

 

原文地址:https://www.cnblogs.com/amy2017/p/10244025.html