* Rebasing local patches
@ 2009-03-07 9:01 Nicolas Morey-Chaisemartin
2009-03-07 11:41 ` Johannes Schindelin
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Morey-Chaisemartin @ 2009-03-07 9:01 UTC (permalink / raw)
To: git@vger.kernel.org
Hello everyone,
I have a few questions about the workflow we sue at work.
On one of our project, we depend on an external source which uses git.
On our side of the project, we create some patches (this part is not the problem), but only some of them are intended to be pushed (ie pulled by) the external source.
So basically, we have a set of patches on local branch that we rebase every so and then against master to keep our version up-to-date with the external one.
Is this the right way to do it?
Then, internally we have a centralized repository and many personal ones. When the need to go to the next version, one of the developper rebases the company patches branch afaisnt master and push it into the centralized repo.
What is the best way for the other developpers to get up-to-date with the rebased branch?
git pull --rebase seems to me like a good way to keep local modifications.
If all our patches were already pushed on the centralized repo, we tend top use git reset --hard origin/our_patches
Final question:
I noticed that when the branch was rebased on the centralized and repo and origin/our_patches is up-to-date in mine.
If I checkout another branch and then ckecout our_branches, I got a message telling my our_patches and the one from the server have diverged (or you are two commits behind...).
How can you get this info directly without leaving/rejoining your branch?
Regards
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Rebasing local patches
2009-03-07 9:01 Rebasing local patches Nicolas Morey-Chaisemartin
@ 2009-03-07 11:41 ` Johannes Schindelin
2009-03-13 7:39 ` Nicolas Morey-Chaisemartin
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2009-03-07 11:41 UTC (permalink / raw)
To: Nicolas Morey-Chaisemartin; +Cc: git@vger.kernel.org
Hi,
On Sat, 7 Mar 2009, Nicolas Morey-Chaisemartin wrote:
> On one of our project, we depend on an external source which uses git.
> On our side of the project, we create some patches (this part is not the
> problem), but only some of them are intended to be pushed (ie pulled by)
> the external source. So basically, we have a set of patches on local
> branch that we rebase every so and then against master to keep our
> version up-to-date with the external one.
>
> Is this the right way to do it?
Looks sane.
> Then, internally we have a centralized repository and many personal
> ones. When the need to go to the next version, one of the developper
> rebases the company patches branch afaisnt master and push it into the
> centralized repo.
>
> What is the best way for the other developpers to get up-to-date with
> the rebased branch?
>
> git pull --rebase seems to me like a good way to keep local modifications.
Indeed.
You could also work from release branches, i.e. whenever you rebase your
company-specific changes onto the upstream, you could start a new branch.
Or even better: you could "merge -s ours" the pre-rebase commit. The
history would then look something like this:
new UPSTREAM - A' - B' - C' - M
/
old UPSTREAM - A - B - C --------------'
The ' commits are the rewritten versions of the original company-specific
ones, made by the rebase.
If you do it that way, not only will you not lose the history of your
project, but your users can happily continue to merge instead of having to
rebase.
> I noticed that when the branch was rebased on the centralized and repo
> and origin/our_patches is up-to-date in mine.
>
> If I checkout another branch and then ckecout our_branches, I got a
> message telling my our_patches and the one from the server have diverged
> (or you are two commits behind...).
>
> How can you get this info directly without leaving/rejoining your
> branch?
It is also part of "git status"' output.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Rebasing local patches
2009-03-07 11:41 ` Johannes Schindelin
@ 2009-03-13 7:39 ` Nicolas Morey-Chaisemartin
2009-03-18 15:48 ` Johannes Schindelin
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Morey-Chaisemartin @ 2009-03-13 7:39 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git@vger.kernel.org
>> I noticed that when the branch was rebased on the centralized and repo
>> and origin/our_patches is up-to-date in mine.
>>
>> If I checkout another branch and then ckecout our_branches, I got a
>> message telling my our_patches and the one from the server have diverged
>> (or you are two commits behind...).
>>
>> How can you get this info directly without leaving/rejoining your
>> branch?
>
> It is also part of "git status"' output.
Is there some option to just get the status of HEAD against tracked branch and not the index status?
I guess I could do an alias but an option would be nicer ;)
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Rebasing local patches
2009-03-13 7:39 ` Nicolas Morey-Chaisemartin
@ 2009-03-18 15:48 ` Johannes Schindelin
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2009-03-18 15:48 UTC (permalink / raw)
To: Nicolas Morey-Chaisemartin; +Cc: git@vger.kernel.org
Hi,
On Fri, 13 Mar 2009, Nicolas Morey-Chaisemartin wrote:
> >> I noticed that when the branch was rebased on the centralized and
> >> repo and origin/our_patches is up-to-date in mine.
> >>
> >> If I checkout another branch and then ckecout our_branches, I got a
> >> message telling my our_patches and the one from the server have
> >> diverged (or you are two commits behind...).
> >>
> >> How can you get this info directly without leaving/rejoining your
> >> branch?
> >
> > It is also part of "git status"' output.
>
> Is there some option to just get the status of HEAD against tracked
> branch and not the index status? I guess I could do an alias but an
> option would be nicer ;)
Just try "git checkout".
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-18 15:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-07 9:01 Rebasing local patches Nicolas Morey-Chaisemartin
2009-03-07 11:41 ` Johannes Schindelin
2009-03-13 7:39 ` Nicolas Morey-Chaisemartin
2009-03-18 15:48 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox