20.创建分支
创建一个新分支
# 新建分支
$ git checkout -b lgnew
Switched to a new branch 'lgnew'
# 查看状态
$ git status
On branch lgnew
nothing to commit, working tree clean在此分支上新建一个文件并提交
# 暂存
git add .\lab\test2.txt
# 提交
$ git commit -m "Added teset2.txt"
[lgnew ead2515] Added teset2.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 lab/test2.txt
# 查看状态
$ git status
On branch lgnew
nothing to commit, working tree clean切换主分支,创建一个新文件并提交
查看提交日志
Last updated