Skip to content

Instantly share code, notes, and snippets.

@cecton
Created November 17, 2016 11:47
Show Gist options
  • Save cecton/326d680b7b28130e7db6abf7eaca0ecb to your computer and use it in GitHub Desktop.
Save cecton/326d680b7b28130e7db6abf7eaca0ecb to your computer and use it in GitHub Desktop.
git rebase --onto
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
[0] [11:38:59] ~ > cd /tmp
[0] [11:39:01] /tmp > mkdir c
[0] [11:39:04] /tmp > cd c
[0] [11:39:05] /t/c > g init .
Initialized empty Git repository in /tmp/c/.git/
[0] [11:39:08] /t/c HEAD > touch a
[0] [11:39:10] /t/c HEAD > g add a
[0] [11:39:12] /t/c HEAD > g commit -m a
[master (root-commit) 6732784] a
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
[0] [11:39:16] /t/c master > g checkout -b b1
Switched to a new branch 'b1'
[0] [11:39:27] /t/c b1 > touch b
[0] [11:39:30] /t/c b1 > g add b
[0] [11:39:32] /t/c b1 > g commit -m b
[b1 1e84062] b
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 b
[0] [11:39:35] /t/c b1 > touch c
[0] [11:39:38] /t/c b1 > g add c
[0] [11:39:41] /t/c b1 > g commit -m c
[b1 c0d52c3] c
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 c
[0] [11:39:46] /t/c b1 > g checkout -b b2
Switched to a new branch 'b2'
[0] [11:39:53] /t/c b2 > touch d
[0] [11:39:56] /t/c b2 > g add d
[0] [11:40:00] /t/c b2 > g commit -m d
[b2 def7138] d
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 d
[0] [11:40:03] /t/c b2 > g checkout master
Switched to branch 'master'
[0] [11:41:32] /t/c master > g merge --squash b1
Updating 6732784..c0d52c3
Fast-forward
Squash commit -- not updating HEAD
b | 0
c | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 b
create mode 100644 c
[0] [11:42:11] /t/c master > g commit -m merged_b1
[master 9c5435e] merged_b1
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 b
create mode 100644 c
[0] [11:42:48] /t/c master > g log
commit 9c5435ecf2baf4c22ae4e8431cca5674a4563005
Author: Cecile Tonglet <cecile.tonglet@gmail.com>
Date: Thu Nov 17 12:42:48 2016 +0100
merged_b1
commit 6732784855b201525da48162160e007a4371cc0e
Author: Cecile Tonglet <cecile.tonglet@gmail.com>
Date: Thu Nov 17 12:39:16 2016 +0100
a
[0] [11:43:00] /t/c master > g checkout b2
Switched to branch 'b2'
[0] [11:44:55] /t/c b2 > g rebase --onto master -i b1
Successfully rebased and updated refs/heads/b2.
[0] [11:45:07] /t/c b2 > g log
commit baf61ab97eb4eae018ec5535d574f90aa4ae7006
Author: Cecile Tonglet <cecile.tonglet@gmail.com>
Date: Thu Nov 17 12:40:03 2016 +0100
d
commit 9c5435ecf2baf4c22ae4e8431cca5674a4563005
Author: Cecile Tonglet <cecile.tonglet@gmail.com>
Date: Thu Nov 17 12:42:48 2016 +0100
merged_b1
commit 6732784855b201525da48162160e007a4371cc0e
Author: Cecile Tonglet <cecile.tonglet@gmail.com>
Date: Thu Nov 17 12:39:16 2016 +0100
a
[0] [11:45:30] /t/c b2 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment