* fast forward a branch from another
@ 2011-05-12 14:40 Eric Frederich
2011-05-12 15:31 ` Michael J Gruber
2011-05-12 16:06 ` Junio C Hamano
0 siblings, 2 replies; 7+ messages in thread
From: Eric Frederich @ 2011-05-12 14:40 UTC (permalink / raw)
To: git
Often times I get into a situation where I have a "development" branch
that gets ahead of say a "stable" branch.
When I am ready to call the development branch stable this is what I do.
$ git checkout stable
$ git merge development
$ git checkout development
The problem here is that the act of going backwards (via checking out
stable) really messes up my IDE and or Text editors.
Is there any way to do this without switching branches, which modifies
my working directory, which messes up my IDE?
Thanks,
~Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 14:40 fast forward a branch from another Eric Frederich
@ 2011-05-12 15:31 ` Michael J Gruber
2011-05-12 15:34 ` Michael J Gruber
2011-05-12 16:06 ` Junio C Hamano
1 sibling, 1 reply; 7+ messages in thread
From: Michael J Gruber @ 2011-05-12 15:31 UTC (permalink / raw)
To: Eric Frederich; +Cc: git
Eric Frederich venit, vidit, dixit 12.05.2011 16:40:
> Often times I get into a situation where I have a "development" branch
> that gets ahead of say a "stable" branch.
> When I am ready to call the development branch stable this is what I do.
>
> $ git checkout stable
> $ git merge development
> $ git checkout development
>
> The problem here is that the act of going backwards (via checking out
> stable) really messes up my IDE and or Text editors.
> Is there any way to do this without switching branches, which modifies
> my working directory, which messes up my IDE?
I assume this is a ff-situation, i.e. stable is fully contained in
developement? then you can reset branch stable like this:
test 0 -eq $(git rev-list --count ^development stable) && git branch -f
stable development
(I thought you could git rev-list --quiet but I'm too dumb :|)
Michael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 15:31 ` Michael J Gruber
@ 2011-05-12 15:34 ` Michael J Gruber
0 siblings, 0 replies; 7+ messages in thread
From: Michael J Gruber @ 2011-05-12 15:34 UTC (permalink / raw)
Cc: Eric Frederich, git
Michael J Gruber venit, vidit, dixit 12.05.2011 17:31:
> Eric Frederich venit, vidit, dixit 12.05.2011 16:40:
>> Often times I get into a situation where I have a "development" branch
>> that gets ahead of say a "stable" branch.
>> When I am ready to call the development branch stable this is what I do.
>>
>> $ git checkout stable
>> $ git merge development
>> $ git checkout development
>>
>> The problem here is that the act of going backwards (via checking out
>> stable) really messes up my IDE and or Text editors.
>> Is there any way to do this without switching branches, which modifies
>> my working directory, which messes up my IDE?
>
> I assume this is a ff-situation, i.e. stable is fully contained in
> developement? then you can reset branch stable like this:
>
> test 0 -eq $(git rev-list --count ^development stable) && git branch -f
> stable development
>
> (I thought you could git rev-list --quiet but I'm too dumb :|)
In fact, am I even too dumb to set my from address today. Sorry! Have to
give "virtual identity" another try...
Michael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 14:40 fast forward a branch from another Eric Frederich
2011-05-12 15:31 ` Michael J Gruber
@ 2011-05-12 16:06 ` Junio C Hamano
2011-05-12 16:26 ` Phil Hord
1 sibling, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2011-05-12 16:06 UTC (permalink / raw)
To: Eric Frederich; +Cc: git
Eric Frederich <eric.frederich@gmail.com> writes:
> Often times I get into a situation where I have a "development" branch
> that gets ahead of say a "stable" branch.
> When I am ready to call the development branch stable this is what I do.
>
> $ git checkout stable
> $ git merge development
> $ git checkout development
Instead of switching to "stable", while still on the development, you
could do
$ git push . HEAD:stable
which would succeed only when you are purely ahead of stable (otherwise it
will fail as you are not forcing).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 16:06 ` Junio C Hamano
@ 2011-05-12 16:26 ` Phil Hord
2011-05-12 16:49 ` Junio C Hamano
0 siblings, 1 reply; 7+ messages in thread
From: Phil Hord @ 2011-05-12 16:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Eric Frederich, git
On 05/12/2011 12:06 PM, Junio C Hamano wrote:
> [...]
> Instead of switching to "stable", while still on the development, you
> could do
>
> $ git push . HEAD:stable
>
> which would succeed only when you are purely ahead of stable (otherwise it
> will fail as you are not forcing).
>
Wow! Another gem. I didn't realize you could use 'dot' to refer to the
same repo you're in.
I don't see this feature listed in the git push [REMOTES] section. Is
it documented somewhere else?
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 16:26 ` Phil Hord
@ 2011-05-12 16:49 ` Junio C Hamano
2011-05-12 16:58 ` Phil Hord
0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2011-05-12 16:49 UTC (permalink / raw)
To: Phil Hord; +Cc: Eric Frederich, git
Phil Hord <hordp@cisco.com> writes:
> I don't see this feature listed in the git push [REMOTES] section. Is
> it documented somewhere else?
Both "git help push" and "git help pull" will tell you in the "Git URLs"
section that a local file path is a way to name a repository. Therefore,
you can say "git ls-remote $(pwd)" to list the the refs from the current
repository. If you are in git.git directory, "git ls-remote ../git.git"
does the same thing, so does "git ls-remote .".
These are merely specializations of more general "git push $path $refspec"
and nothing noteworthy.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: fast forward a branch from another
2011-05-12 16:49 ` Junio C Hamano
@ 2011-05-12 16:58 ` Phil Hord
0 siblings, 0 replies; 7+ messages in thread
From: Phil Hord @ 2011-05-12 16:58 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Eric Frederich, git
On 05/12/2011 12:49 PM, Junio C Hamano wrote:
> Phil Hord <hordp@cisco.com> writes:
>
>> I don't see this feature listed in the git push [REMOTES] section. Is
>> it documented somewhere else?
> Both "git help push" and "git help pull" will tell you in the "Git URLs"
> section that a local file path is a way to name a repository. Therefore,
> you can say "git ls-remote $(pwd)" to list the the refs from the current
> repository. If you are in git.git directory, "git ls-remote ../git.git"
> does the same thing, so does "git ls-remote .".
>
> These are merely specializations of more general "git push $path $refspec"
> and nothing noteworthy.
Thanks for pointing out the obvious to me. I guess I was thinking of it
as a parallel to '-', as in 'git checkout -', and simultaneously
distracted by the surprise realization that one can push from/to the
self-same repository.
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-12 16:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12 14:40 fast forward a branch from another Eric Frederich
2011-05-12 15:31 ` Michael J Gruber
2011-05-12 15:34 ` Michael J Gruber
2011-05-12 16:06 ` Junio C Hamano
2011-05-12 16:26 ` Phil Hord
2011-05-12 16:49 ` Junio C Hamano
2011-05-12 16:58 ` Phil Hord
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).