查看分支
git branch
命令行输出
创建新分支
git branch test1 git branch
命令行输出
切换分支
ls echo 'test' > test1.txt git add . git commit -m 'add test1.txt' ls git checkout test1 ls git branch
命令行输出
新创建分支并切换分支后在该分支下工作
git checkout -b test2 echo 'test2' > test2.txt git add . git commit -m 'add test2.txt' git branch ls git checkout test1 ls