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. Edge 自动给数字加下划线的问题

    <meta name="format-detection" content="telephone=no,email=no,address=no">

  2. (转)ASP.NET基础之HttpHandler学习

    原文地址:http://www.cnblogs.com/wujy/archive/2013/08/18/3266009.html 经过前两篇[ASP.NET基础之HttpModule学习]和[ASP. ...

  3. Java主线程如何等待子线程执行结束(转)

    工作中往往会遇到异步去执行某段逻辑, 然后先处理其他事情, 处理完后再把那段逻辑的处理结果进行汇总的产景, 这时候就需要使用线程了. 一个线程启动之后, 是异步的去执行需要执行的内容的, 不会影响主线 ...

  4. jQuery高级

    一.动画效果 常用的几种效果都是没有easing参数的,也即动画只能swing.$(selector).animate(styles,speed,easing,callback)中是有easing参数 ...

  5. ecliplse导入tomcat

    上面点击之后,弹出的窗口最大化: 导入成功之后如下图:

  6. strcmp返回值布尔类型的判断

    strcmp: 用于比较两个字符串,原型如下: int strcmp ( char const *s1, char const *s2):如果s1小于s2,strcmp函数返回一个小于零的值.如果s1 ...

  7. Bitnami WordPress如何修改MySQL root的默认密码?

    Bitnami WordPress安装完毕后,MySQL root的默认密码为空,我们应该马上修改MySQL密码,在开始菜单里面,进入Bitnami ,启动控制台程序,随后输入: mysql -u r ...

  8. plantix插件工具,eclipse工具

    代码修改后部署流程: 修改代码-->自动构建工作空间(将修改的代码或配置文件复制到classes文件夹)-->发布到tomcat环境中-->重启服务器运行 常见报错:java.lan ...

  9. Flutter的使用教学笔记

    QQ交流群 Flutter 程序开发群:766307130 教程 官方实战 使用Flutter 构建精美的页面 云在千峰 博主一直是从事 Android 开发的,所以主要从 Android 技术角度来 ...

  10. 【SSO单点系列】(6):CAS4.0 单点流程序列图(中文版)以及相关术语解释(TGT、ST、PGT、PT、PGTIOU)

    CAS 相关的内容好久没写了,可能下周会继续更新一些内容吧. 在上一篇中的单点流程序列图由于是从官网直接下载来的,上面都是英文,可能有的朋友看不懂,因此修改成中文的. PS:只修改了一个,第二个图明天 ...