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. html页面源代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. HTML5之:link与title的区别

    [link]标签:外联导入样式 例1:<link rel="stylesheet" type="text/css" href="theme.cs ...

  3. C++中的Trivial 、POD、non-POD和Standard Layout概念

    POD types non-POD types Standard Layout types A Formal Definition Informally, a standard layout clas ...

  4. java多线程的基本介绍

    Java多线程 1.进程与线程 进程是程序的一次动态执行过程,它需要经历从代码加载,代码执行到执行完毕的一个完整的过程,这个过程也是进程本身从产生,发展到最终消亡的过程.多进程操作系统能同时达运行多个 ...

  5. Bitmap类、BitmapFactory及BitmapFactory类中的常用方法

    1.Bitmap 1.1非静态方法 public void recycle()——回收位图占用的内存空间,把位图标记为Dead public final boolean isRecycled() —— ...

  6. .net Stream篇(四)

    FileStream 目录: 如何去理解FileStream? FileStream的重要性 FileStream常用构造函数(重要) 非托管参数SafeFileHandle简单介绍 FileStre ...

  7. Scrapy 增量式爬虫

    Scrapy 增量式爬虫 https://blog.csdn.net/mygodit/article/details/83931009 https://blog.csdn.net/mygodit/ar ...

  8. xunsearch

    xunsearch 1.wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2 2.解压 tar -jxvf xuns ...

  9. 4.jQuery和DOM 对象之间的相互转换

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  10. 搭建svn管理平台

    安装svn服务器:yum -y install subversion 创建svn的目录:mkdir -p /data/svn 初始化svn目录:svnadmin create /data/svn co ...