Git rebase vs merge.If git rebase will make tags missing?
A-B-C-D-E-F master
H-I-J feature
|
tag v1.0
what if I reabse master feature
? Will the tag1.0 be missing?
git rebase git-rebase
add a comment |
A-B-C-D-E-F master
H-I-J feature
|
tag v1.0
what if I reabse master feature
? Will the tag1.0 be missing?
git rebase git-rebase
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13
add a comment |
A-B-C-D-E-F master
H-I-J feature
|
tag v1.0
what if I reabse master feature
? Will the tag1.0 be missing?
git rebase git-rebase
A-B-C-D-E-F master
H-I-J feature
|
tag v1.0
what if I reabse master feature
? Will the tag1.0 be missing?
git rebase git-rebase
git rebase git-rebase
edited Nov 26 '18 at 14:58
phd
24.2k52647
24.2k52647
asked Nov 26 '18 at 13:05
JulesJules
18629
18629
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13
add a comment |
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13
add a comment |
1 Answer
1
active
oldest
votes
The tag won't be missing but it will probably not do what you want. That is the tag will stay on I
:
A-B-C-D-E-F master
|
H'-I'-J' feature
H-I-J
|
tag v1.0
Try it:
$ git init
$ for c in {A..F}; do touch $c; git add $c; git commit -m $c; done
$ git checkout -b feature HEAD^{/C}
$ for c in {H..J}; do touch $c; git add $c; git commit -m $c; done
$ git tag 'tag-v1.0' feature^{/I}
$ git log --graph --decorate --all --oneline
* d782b9d (HEAD -> feature) J
* c0df2db (tag: tag-v1.0) I
* 2a9fb01 H
| * 3018edf (master) F
| * e0eabe0 E
| * daab573 D
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
$ git rebase master feature
$ git log --graph --decorate --all --oneline
* 091cf03 (HEAD -> feature) J
* 6327f84 I
* 69123dd H
* 3018edf (master) F
* e0eabe0 E
* daab573 D
| * c0df2db (tag: tag-v1.0) I
| * 2a9fb01 H
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
Notes:
HEAD^{/C}
reference the most recent commit reachable from HEAD whose message matches C
, see gitrevisions:
<rev>^{/<text>}
, e.g.HEAD^{/fix nasty bug}
A suffix
^
to a revision parameter, followed by a brace pair that contains a text led by a slash, is the same as the:/fix nasty bug
syntax below except that it returns the youngest matching commit which is reachable from the<rev>
before^
.
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen theHEAD^{/C}
reference before, it is used to find the most recent commit reachable fromHEAD
whose message matchesC
. See gitrevisions(7).
– cmbuckley
Nov 26 '18 at 13:57
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53481774%2fgit-rebase-vs-merge-if-git-rebase-will-make-tags-missing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The tag won't be missing but it will probably not do what you want. That is the tag will stay on I
:
A-B-C-D-E-F master
|
H'-I'-J' feature
H-I-J
|
tag v1.0
Try it:
$ git init
$ for c in {A..F}; do touch $c; git add $c; git commit -m $c; done
$ git checkout -b feature HEAD^{/C}
$ for c in {H..J}; do touch $c; git add $c; git commit -m $c; done
$ git tag 'tag-v1.0' feature^{/I}
$ git log --graph --decorate --all --oneline
* d782b9d (HEAD -> feature) J
* c0df2db (tag: tag-v1.0) I
* 2a9fb01 H
| * 3018edf (master) F
| * e0eabe0 E
| * daab573 D
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
$ git rebase master feature
$ git log --graph --decorate --all --oneline
* 091cf03 (HEAD -> feature) J
* 6327f84 I
* 69123dd H
* 3018edf (master) F
* e0eabe0 E
* daab573 D
| * c0df2db (tag: tag-v1.0) I
| * 2a9fb01 H
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
Notes:
HEAD^{/C}
reference the most recent commit reachable from HEAD whose message matches C
, see gitrevisions:
<rev>^{/<text>}
, e.g.HEAD^{/fix nasty bug}
A suffix
^
to a revision parameter, followed by a brace pair that contains a text led by a slash, is the same as the:/fix nasty bug
syntax below except that it returns the youngest matching commit which is reachable from the<rev>
before^
.
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen theHEAD^{/C}
reference before, it is used to find the most recent commit reachable fromHEAD
whose message matchesC
. See gitrevisions(7).
– cmbuckley
Nov 26 '18 at 13:57
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
add a comment |
The tag won't be missing but it will probably not do what you want. That is the tag will stay on I
:
A-B-C-D-E-F master
|
H'-I'-J' feature
H-I-J
|
tag v1.0
Try it:
$ git init
$ for c in {A..F}; do touch $c; git add $c; git commit -m $c; done
$ git checkout -b feature HEAD^{/C}
$ for c in {H..J}; do touch $c; git add $c; git commit -m $c; done
$ git tag 'tag-v1.0' feature^{/I}
$ git log --graph --decorate --all --oneline
* d782b9d (HEAD -> feature) J
* c0df2db (tag: tag-v1.0) I
* 2a9fb01 H
| * 3018edf (master) F
| * e0eabe0 E
| * daab573 D
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
$ git rebase master feature
$ git log --graph --decorate --all --oneline
* 091cf03 (HEAD -> feature) J
* 6327f84 I
* 69123dd H
* 3018edf (master) F
* e0eabe0 E
* daab573 D
| * c0df2db (tag: tag-v1.0) I
| * 2a9fb01 H
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
Notes:
HEAD^{/C}
reference the most recent commit reachable from HEAD whose message matches C
, see gitrevisions:
<rev>^{/<text>}
, e.g.HEAD^{/fix nasty bug}
A suffix
^
to a revision parameter, followed by a brace pair that contains a text led by a slash, is the same as the:/fix nasty bug
syntax below except that it returns the youngest matching commit which is reachable from the<rev>
before^
.
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen theHEAD^{/C}
reference before, it is used to find the most recent commit reachable fromHEAD
whose message matchesC
. See gitrevisions(7).
– cmbuckley
Nov 26 '18 at 13:57
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
add a comment |
The tag won't be missing but it will probably not do what you want. That is the tag will stay on I
:
A-B-C-D-E-F master
|
H'-I'-J' feature
H-I-J
|
tag v1.0
Try it:
$ git init
$ for c in {A..F}; do touch $c; git add $c; git commit -m $c; done
$ git checkout -b feature HEAD^{/C}
$ for c in {H..J}; do touch $c; git add $c; git commit -m $c; done
$ git tag 'tag-v1.0' feature^{/I}
$ git log --graph --decorate --all --oneline
* d782b9d (HEAD -> feature) J
* c0df2db (tag: tag-v1.0) I
* 2a9fb01 H
| * 3018edf (master) F
| * e0eabe0 E
| * daab573 D
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
$ git rebase master feature
$ git log --graph --decorate --all --oneline
* 091cf03 (HEAD -> feature) J
* 6327f84 I
* 69123dd H
* 3018edf (master) F
* e0eabe0 E
* daab573 D
| * c0df2db (tag: tag-v1.0) I
| * 2a9fb01 H
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
Notes:
HEAD^{/C}
reference the most recent commit reachable from HEAD whose message matches C
, see gitrevisions:
<rev>^{/<text>}
, e.g.HEAD^{/fix nasty bug}
A suffix
^
to a revision parameter, followed by a brace pair that contains a text led by a slash, is the same as the:/fix nasty bug
syntax below except that it returns the youngest matching commit which is reachable from the<rev>
before^
.
The tag won't be missing but it will probably not do what you want. That is the tag will stay on I
:
A-B-C-D-E-F master
|
H'-I'-J' feature
H-I-J
|
tag v1.0
Try it:
$ git init
$ for c in {A..F}; do touch $c; git add $c; git commit -m $c; done
$ git checkout -b feature HEAD^{/C}
$ for c in {H..J}; do touch $c; git add $c; git commit -m $c; done
$ git tag 'tag-v1.0' feature^{/I}
$ git log --graph --decorate --all --oneline
* d782b9d (HEAD -> feature) J
* c0df2db (tag: tag-v1.0) I
* 2a9fb01 H
| * 3018edf (master) F
| * e0eabe0 E
| * daab573 D
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
$ git rebase master feature
$ git log --graph --decorate --all --oneline
* 091cf03 (HEAD -> feature) J
* 6327f84 I
* 69123dd H
* 3018edf (master) F
* e0eabe0 E
* daab573 D
| * c0df2db (tag: tag-v1.0) I
| * 2a9fb01 H
|/
* 8ebf4bb C
* 82be26d B
* 8379c01 A
Notes:
HEAD^{/C}
reference the most recent commit reachable from HEAD whose message matches C
, see gitrevisions:
<rev>^{/<text>}
, e.g.HEAD^{/fix nasty bug}
A suffix
^
to a revision parameter, followed by a brace pair that contains a text led by a slash, is the same as the:/fix nasty bug
syntax below except that it returns the youngest matching commit which is reachable from the<rev>
before^
.
edited Nov 26 '18 at 14:07
answered Nov 26 '18 at 13:09
Micha WiedenmannMicha Wiedenmann
10.6k1364106
10.6k1364106
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen theHEAD^{/C}
reference before, it is used to find the most recent commit reachable fromHEAD
whose message matchesC
. See gitrevisions(7).
– cmbuckley
Nov 26 '18 at 13:57
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
add a comment |
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen theHEAD^{/C}
reference before, it is used to find the most recent commit reachable fromHEAD
whose message matchesC
. See gitrevisions(7).
– cmbuckley
Nov 26 '18 at 13:57
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
The tag won't be missing, I just try it.Your answer make me more clear about git usage.Thanks a lot.
– Jules
Nov 26 '18 at 13:30
For those (like me) who haven’t seen the
HEAD^{/C}
reference before, it is used to find the most recent commit reachable from HEAD
whose message matches C
. See gitrevisions(7).– cmbuckley
Nov 26 '18 at 13:57
For those (like me) who haven’t seen the
HEAD^{/C}
reference before, it is used to find the most recent commit reachable from HEAD
whose message matches C
. See gitrevisions(7).– cmbuckley
Nov 26 '18 at 13:57
1
1
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
@cmbuckley In my humble opinion, just edit the answer instead of leaving a comment. Your comment contains valuable information and other readers will benefit.
– Micha Wiedenmann
Nov 26 '18 at 14:09
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53481774%2fgit-rebase-vs-merge-if-git-rebase-will-make-tags-missing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you try it? What did you expect and why?
– Micha Wiedenmann
Nov 26 '18 at 13:06
I am not sure.I expect the tag is the same as when I execute git tag. I will try now.I jus read git-scm.com/book/en/v2/Git-Branching-Rebasing which make me puzzle.
– Jules
Nov 26 '18 at 13:13