git分支的使用
2020-02-07Linux90root290°c
A+ A-查看分支
[[email protected] yunweigit-]# git branch * master
创建分支
[[email protected] yunweigit-]# git branch azhen [[email protected] yunweigit-]# git branch azhen * master
带*是当前的分支
切换分支
[[email protected] yunweigit-]# git checkout azhen Switched to branch 'azhen' [[email protected] yunweigit-]# git branch * azhen master
在azhen分支下 ,编辑999.txt,并提交到新分支
[[email protected] yunweigit-]# cat 999.txt 运维搬运工 [[email protected] yunweigit-]# git add 999.txt [[email protected] yunweigit-]# git commit -m "add a 999.txt" [azhen 6f2009e] add a 999.txt 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 999.txt
切换分支查看
[[email protected] yunweigit-]# ls 999.txt lanmp.sh yunweibanyungong.txt [[email protected] yunweigit-]# git checkout master Switched to branch 'master' [[email protected] yunweigit-]# ls lanmp.sh yunweibanyungong.txt
标签:Git