Microsoft Windows [版本 10.0.17134.345]
(c) Microsoft Corporation。保留所有权利。 C:\Users\zhangyang\Desktop\branch>git init
Initialized empty Git repository in C:/Users/zhangyang/Desktop/branch/.git/ C:\Users\zhangyang\Desktop\branch>git commit -m "Init Commit" --allow-empty
[master (root-commit) 468be32] Init Commit C:\Users\zhangyang\Desktop\branch>git commit -m "C1" --allow-empty
[master f91e414] C1 C:\Users\zhangyang\Desktop\branch>git commit -m "C2" --allow-empty
[master c738d28] C2 C:\Users\zhangyang\Desktop\branch>git commit -m "C3" --allow-empty
[master 09c5904] C3 C:\Users\zhangyang\Desktop\branch>git checkout -b branch1
Switched to a new branch 'branch1' C:\Users\zhangyang\Desktop\branch>git commit -m "C4" --allow-empty
[branch1 60f5e77] C4 C:\Users\zhangyang\Desktop\branch>git commit -m "C5" --allow-empty
[branch1 85a8fe7] C5 C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --graph --all
* 85a8fe7 (HEAD -> branch1) C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout 85a9fe7
error: pathspec '85a9fe7' did not match any file(s) known to git. C:\Users\zhangyang\Desktop\branch>git checkout 85a8fe7
Note: checking out '85a8fe7'. You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at 85a8fe7 C5 C:\Users\zhangyang\Desktop\branch>git commit -m "C6" --allow-empty
[detached HEAD 3f0d0e2] C6 C:\Users\zhangyang\Desktop\branch>git commit -m "C7" --allow-empty
[detached HEAD 9724be1] C7 C:\Users\zhangyang\Desktop\branch>git commit -m "C8" --allow-empty
[detached HEAD ba2e2d2] C8 C:\Users\zhangyang\Desktop\branch>git status
HEAD detached from 85a8fe7
nothing to commit, working tree clean C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --graph --all
* ba2e2d2 (HEAD) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 (branch1) C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git show 3f0d0e2
commit 3f0d0e290a94035f504cb1fb43065b09ed782172
Author: yqmcu <yqmcu@foxmail.com>
Date: Mon Feb :: + C6 C:\Users\zhangyang\Desktop\branch>git show 85a8fe7
commit 85a8fe7ad54cde82285d866536a8d7cd6d74f6cb (branch1)
Author: yqmcu <yqmcu@foxmail.com>
Date: Mon Feb :: + C5 C:\Users\zhangyang\Desktop\branch>git checkout -b HEAD
fatal: 'HEAD' is not a valid branch name. C:\Users\zhangyang\Desktop\branch>git checkout -b detached
Switched to a new branch 'detached' C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --all --graph
* ba2e2d2 (HEAD -> detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 (branch1) C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout branch1
Switched to branch 'branch1' C:\Users\zhangyang\Desktop\branch>git cherry-pick detached
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use: git commit --allow-empty Otherwise, please use 'git reset'
On branch branch1
You are currently cherry-picking commit ba2e2d2. nothing to commit, working tree clean C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --all --graph
* ba2e2d2 (detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 (HEAD -> branch1) C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git commit --allow-empty
[branch1 7edcbff] C8
Date: Mon Feb :: + C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --all --graph
* 7edcbff (HEAD -> branch1) C8
| * ba2e2d2 (detached) C8
| * 9724be1 C7
| * 3f0d0e2 C6
|/
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --graph
* 7edcbff (HEAD -> branch1) C8
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout master
Switched to branch 'master' C:\Users\zhangyang\Desktop\branch>git rebase merge branch1 --no-ff
fatal: Needed a single revision
invalid upstream 'merge' C:\Users\zhangyang\Desktop\branch>git merge branch1 --no-ff
Already up to date!
Merge made by the 'recursive' strategy. C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --graph
* 6e2328f (HEAD -> master) Merge branch 'branch1'
|\
| * 7edcbff (branch1) C8
| * 85a8fe7 C5
| * 60f5e77 C4
|/
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git log --oneline --decorate --graph --all
* 6e2328f (HEAD -> master) Merge branch 'branch1'
|\
| * 7edcbff (branch1) C8
| | * ba2e2d2 (detached) C8
| | * 9724be1 C7
| | * 3f0d0e2 C6
| |/
| * 85a8fe7 C5
| * 60f5e77 C4
|/
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout -b --help
fatal: '--help' is not a valid branch name. C:\Users\zhangyang\Desktop\branch>git checkout --help C:\Users\zhangyang\Desktop\branch>git checkout -b old 85a8fe7
Switched to a new branch 'old' C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* 85a8fe7 (HEAD -> old) C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git cherry-pick branch1
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use: git commit --allow-empty Otherwise, please use 'git reset'
On branch old
You are currently cherry-picking commit 7edcbff. nothing to commit, working tree clean C:\Users\zhangyang\Desktop\branch>git commit --allow-empty
[old 11d5930] C8
Date: Mon Feb :: + C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* 11d5930 (HEAD -> old) C8
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git reset 85a8fe7 --hard
HEAD is now at 85a8fe7 C5 C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* 85a8fe7 (HEAD -> old) C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git rebase branch1
First, rewinding head to replay your work on top of it...
Fast-forwarded old to branch1. C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* 7edcbff (HEAD -> old, branch1) C8
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git reset 85a8fe7 --hard
HEAD is now at 85a8fe7 C5 C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* 85a8fe7 (HEAD -> old) C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git merge branch1 --no-ff
Already up to date!
Merge made by the 'recursive' strategy. C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* a6aea9e (HEAD -> old) Merge branch 'branch1' into old
|\
| * 7edcbff (branch1) C8
|/
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git reset 85a8fe7 --hard
HEAD is now at 85a8fe7 C5 C:\Users\zhangyang\Desktop\branch>git rebase detached
First, rewinding head to replay your work on top of it...
Fast-forwarded old to detached. C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* ba2e2d2 (HEAD -> old, detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git log --oneline --graph
* ba2e2d2 (HEAD -> old, detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* 6e2328f (master) Merge branch 'branch1'
|\
| * 7edcbff (branch1) C8
| | * ba2e2d2 (HEAD -> old, detached) C8
| | * 9724be1 C7
| | * 3f0d0e2 C6
| |/
| * 85a8fe7 C5
| * 60f5e77 C4
|/
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout master
Switched to branch 'master' C:\Users\zhangyang\Desktop\branch>git reset 09c5904 --hard
HEAD is now at 09c5904 C3 C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* 7edcbff (branch1) C8
| * ba2e2d2 (old, detached) C8
| * 9724be1 C7
| * 3f0d0e2 C6
|/
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 (HEAD -> master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout branch1
Switched to branch 'branch1' C:\Users\zhangyang\Desktop\branch>git reset 85a8fe7 --hard
HEAD is now at 85a8fe7 C5 C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* ba2e2d2 (old, detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 (HEAD -> branch1) C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git rebase detached
First, rewinding head to replay your work on top of it...
Fast-forwarded branch1 to detached. C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* ba2e2d2 (HEAD -> branch1, old, detached) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 (master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git checkout master
Switched to branch 'master' C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* ba2e2d2 (old, detached, branch1) C8
* 9724be1 C7
* 3f0d0e2 C6
* 85a8fe7 C5
* 60f5e77 C4
* 09c5904 (HEAD -> master) C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>git merge branch1 --no-ff
Already up to date!
Merge made by the 'recursive' strategy. C:\Users\zhangyang\Desktop\branch>git log --oneline --graph --all --decorate
* 6e056d3 (HEAD -> master) Merge branch 'branch1'
|\
| * ba2e2d2 (old, detached, branch1) C8
| * 9724be1 C7
| * 3f0d0e2 C6
| * 85a8fe7 C5
| * 60f5e77 C4
|/
* 09c5904 C3
* c738d28 C2
* f91e414 C1
* 468be32 Init Commit C:\Users\zhangyang\Desktop\branch>

Git merge rebase cherry-pick 以及 游离commit 的测试的更多相关文章

  1. git之rebase、merge和cherry pick的区别(面试常问)

    git flow图例镇楼 merge 这个简单,初学者常用.比如主分支是Dev,最新版本是01.然后小明基于此,搞了个feature 分支A,业务:打酱油.然后在上面多次提交,完成功能迭代开发,如A1 ...

  2. git merge rebase的区别及应用场景

    前两天和同事交流发现他在日常开发中跟上游保持同步每次都是用git pull操作,而我一直习惯git fetch然后rebase,发现这两种操作后的log是有些区别的.他每次pull操作之后都会自动生成 ...

  3. git merge / rebase 分支的新建与合并

    merge https://git-scm.com/book/zh/v2/Git-%E5%88%86%E6%94%AF-%E5%88%86%E6%94%AF%E7%9A%84%E6%96%B0%E5% ...

  4. git merge 和 git rebase 小结

    Git merge是用来合并两个分支的. git merge b # 将b分支合并到当前分支 同样 git rebase b,也是把 b分支合并到当前分支 ---------------------- ...

  5. Git merge 与 git rebase的区别

    Git merge的用法: git merge Dev // Dev表示某分支,表示在当前分支合并Dev分支 git merge -m  "Merge from Dev"  Dev ...

  6. Git merge && git rebase的用法

    Git merge的用法: git merge Dev // Dev表示某分支,表示在当前分支合并Dev分支 git merge -m  “Merge from Dev”  Dev //-m可以加上m ...

  7. git merge和git rebase

    转载于http://blog.csdn.net/wh_19910525/article/details/7554489 git merge是用来合并两个分支的. git merge b # 将b分支合 ...

  8. git merge与git rebase

    文章源:https://blog.csdn.net/wh_19910525/article/details/7554489 git merge是用来合并两个分支的. git merge b # 将b分 ...

  9. git merge 和 git rebase 小结(转)

    git merge是用来合并两个分支的. git merge b # 将b分支合并到当前分支 同样 git rebase b,也是把 b分支合并到当前分支 ---------------------- ...

随机推荐

  1. hdu 4768 Flyer (异或操作的应用)

    2013年长春网络赛1010题 继巴斯博弈(30分钟)签到后,有一道必过题(一眼即有思路). 思路老早就有(40分钟):倒是直到3小时后才被A掉.期间各种换代码姿态! 共享思路: unlucky st ...

  2. Asp.Net程序目录下文件夹或文件操作导致Session失效的解决方案

    1.配置web.config <system.web> <sessionState mode="StateServer" stateConnectionStrin ...

  3. WCF项目问题1-找不到类型“WCFService.Service1”,它在 ServiceHost 指令中提供为 Service 特性值,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。

    找不到类型“WCFService.Service1”,它在 ServiceHost 指令中提供为 Service 特性值,或在配置元素 system.serviceModel/serviceHosti ...

  4. Linux 的文件系统

    Linux 文件属性 文件属性示意图 第一栏代表这个文件的类型与权限(permission): FHS Filesystem Hierarchy Standard(文件系统层次化标准) 1. / (r ...

  5. [GO]局部变量的特点

    package main import "fmt" func main() { //定义在{}里的变量就是局部变量,只能在{}里起作用 //作用域,变量起作用的范围 //执行到定义 ...

  6. C#调用OCX控件的常用方法[转]

    小伙伴们在使用ICP提供的各种能力进行集成开发时常常会遇到一些技术上的困扰,例如ICP中很多接口是通过OCX控件的方式提供的,如何调用这些接口,就成了一个不大不小的问题,毕竟开发指南上可没这些内容啊~ ...

  7. Sql Server 公用表达式(CTE)

    简介 对于select查询语句来说,通常情况下,为了使T-SQL代码更加简洁和可续,在一个查询中引入另外的结果集都是通过视图而不是子查询来进行分解的,但是,视图是作为系统对象存在数据库中,那对于结果集 ...

  8. I-team 博客全文检索 Elasticsearch 实战

    一直觉得博客缺点东西,最近还是发现了,当博客慢慢多起来的时候想要找一篇之前写的博客很是麻烦,于是作为后端开发的楼主觉得自己动手丰衣足食,也就有了这次博客全文检索功能Elasticsearch实战,这里 ...

  9. WebJars——web端静态资源的jar包

    1.WebJars介绍 Web前端使用了越来越多的JS或CSS,如jQuery,Backbone.js和Bootstrap.一般情况下,我们是将这些Web资源拷贝到Java Web项目的webapp相 ...

  10. sql中日期转换

    date_format的函数使用令日期格式转换变得十分便捷首先先说一个自己粗心踩到的坑.因为最开始自己建的表里面存的数据,已经固定是周一的时间了,然后有一个状态判断是需要拿到所有周一是否有数据,当时忘 ...