一、分支
[root@git-01 git_data]# git log --oneline --decorate
54b1c91 (HEAD, master) rename 2 a #默认分支指向我最后一次的提交, HEAD头指针
c350ddf commit 2
62efaf1 commit a
bfeaae3 commit 2
创建指针
[root@git-01 git_data]# git branch test ##创建指针
[root@git-01 git_data]# git branch ##查看在哪个分支下工作
* master
test
切换分支
[root@git-01 git_data]# git checkout test #切换test分支
M a
Switched to branch 'test'[root@git-01 git_data]# git branch ##查看分支
master
* test
----
创建文件开始分支上传
root@git-01 git_data]# touch test
[root@git-01 git_data]# git add .
[root@git-01 git_data]# git commit -m "commit test"
[test 7755e05] commit test
2 files changed, 1 insertion(+)
create mode 100644 test
[root@git-01 git_data]# git checkout master #切换分支
Switched to branch 'master'
[root@git-01 git_data]# git branch #查看分支
* master
test
[root@git-01 git_data]# ls
3 4 5 a
[root@git-01 git_data]# touch master
[root@git-01 git_data]# git add .
[root@git-01 git_data]# git commit -m "commit master"
[master a7c35bd] commit master
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 master
合并分支
[root@git-01 git_data]# git merge test #合并分支。会让填写信息,wq!保存就行
二、标签
有问题请加博主微信进行沟通!
全部评论