git 应用

来源:互联网 发布:asp.net编程 编辑:程序博客网 时间:2024/06/05 23:47

在当前HEAD上创建分支$ git branch testing,这里并没有改变HEAD的位置,只是新建了一个分支,而且这个testing分支和master分支的指针指向同一个快照

查看各个指针指向快照的位置(HEAD指针和所有的分支指针)$ git log --oneline --decorate

切换到testing分支指针上$ git checkout testing

在testing分支指针上提交 git commit -a -m 'made a change'

回到master分支指针上并提交$ git checkout master$ git commit -a -m 'made other changes'

查看所有分支 $ git log --oneline --decorate --graph --all
参考文献:
https://git-scm.com/book/zh/v2/Git-%E5%88%86%E6%94%AF-%E5%88%86%E6%94%AF%E7%AE%80%E4%BB%8B

原创粉丝点击