{"thread":{"id":"18185","subject":"Rebasing local patches","startedAt":"2009-03-07T09:01:22Z","lastAt":"2009-03-18T15:48:15Z","messageCount":4,"participants":["Nicolas Morey-Chaisemartin","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107279","messageId":"49B237E2.3080606@morey-chaisemartin.com","threadId":"18185","inReplyTo":null,"subject":"Rebasing local patches","fromName":"Nicolas Morey-Chaisemartin","fromEmail":"devel@morey-chaisemartin.com","sentAt":"2009-03-07T09:01:22Z","receivedAt":"2009-03-07T09:01:22Z","isPatch":false,"sender":{"key":"devel@morey-chaisemartin.com","avatar":null},"body":"Hello everyone, \n\nI have a few questions about the workflow we sue at work.\nOn one of our project, we depend on an external source which uses git.\nOn 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.\nSo 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.\n\nIs this the right way to do it?\n\nThen, 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.\nWhat is the best way for the other developpers to get up-to-date with the rebased branch? \ngit pull --rebase seems to me like a good way to keep local modifications.\nIf all our patches were already pushed on the centralized repo, we tend top use git reset --hard origin/our_patches\n\nFinal question:\nI noticed that when the branch was rebased on the centralized and repo and origin/our_patches is up-to-date in mine. \nIf 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...).\nHow can you get this info directly without leaving/rejoining your branch?\n\n\nRegards\n\nNicolas\n"},{"id":"107287","messageId":"alpine.DEB.1.00.0903071229220.10279@pacific.mpi-cbg.de","threadId":"18185","inReplyTo":"49B237E2.3080606@morey-chaisemartin.com","subject":"Re: Rebasing local patches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-07T11:41:08Z","receivedAt":"2009-03-07T11:41:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 7 Mar 2009, Nicolas Morey-Chaisemartin wrote:\n\n> On one of our project, we depend on an external source which uses git. \n> On our side of the project, we create some patches (this part is not the \n> problem), but only some of them are intended to be pushed (ie pulled by) \n> the external source. So basically, we have a set of patches on local \n> branch that we rebase every so and then against master to keep our \n> version up-to-date with the external one.\n> \n> Is this the right way to do it?\n\nLooks sane.\n\n> Then, internally we have a centralized repository and many personal \n> ones. When the need to go to the next version, one of the developper \n> rebases the company patches branch afaisnt master and push it into the \n> centralized repo.\n>\n> What is the best way for the other developpers to get up-to-date with \n> the rebased branch?\n>\n> git pull --rebase seems to me like a good way to keep local modifications.\n\nIndeed.\n\nYou could also work from release branches, i.e. whenever you rebase your \ncompany-specific changes onto the upstream, you could start a new branch.\n\nOr even better: you could \"merge -s ours\" the pre-rebase commit.  The \nhistory would then look something like this:\n\n           new UPSTREAM - A' - B' - C' - M\n                                        /\nold UPSTREAM - A - B - C --------------'\n\nThe ' commits are the rewritten versions of the original company-specific \nones, made by the rebase.\n\nIf you do it that way, not only will you not lose the history of your \nproject, but your users can happily continue to merge instead of having to \nrebase.\n\n> I noticed that when the branch was rebased on the centralized and repo \n> and origin/our_patches is up-to-date in mine.\n>\n> If I checkout another branch and then ckecout our_branches, I got a \n> message telling my our_patches and the one from the server have diverged \n> (or you are two commits behind...).\n>\n> How can you get this info directly without leaving/rejoining your \n> branch?\n\nIt is also part of \"git status\"' output.\n\nCiao,\nDscho\n"},{"id":"107911","messageId":"49BA0DBB.7000700@morey-chaisemartin.com","threadId":"18185","inReplyTo":"alpine.DEB.1.00.0903071229220.10279@pacific.mpi-cbg.de","subject":"Re: Rebasing local patches","fromName":"Nicolas Morey-Chaisemartin","fromEmail":"devel@morey-chaisemartin.com","sentAt":"2009-03-13T07:39:39Z","receivedAt":"2009-03-13T07:39:39Z","isPatch":false,"sender":{"key":"devel@morey-chaisemartin.com","avatar":null},"body":">> I noticed that when the branch was rebased on the centralized and repo \n>> and origin/our_patches is up-to-date in mine.\n>>\n>> If I checkout another branch and then ckecout our_branches, I got a \n>> message telling my our_patches and the one from the server have diverged \n>> (or you are two commits behind...).\n>>\n>> How can you get this info directly without leaving/rejoining your \n>> branch?\n> \n> It is also part of \"git status\"' output.\n\nIs there some option to just get the status of HEAD against tracked branch and not the index status? \nI guess I could do an alias but an option would be nicer ;)\n\nNicolas\n"},{"id":"108377","messageId":"alpine.DEB.1.00.0903181647540.10279@pacific.mpi-cbg.de","threadId":"18185","inReplyTo":"49BA0DBB.7000700@morey-chaisemartin.com","subject":"Re: Rebasing local patches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-18T15:48:15Z","receivedAt":"2009-03-18T15:48:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 13 Mar 2009, Nicolas Morey-Chaisemartin wrote:\n\n> >> I noticed that when the branch was rebased on the centralized and \n> >> repo and origin/our_patches is up-to-date in mine.\n> >>\n> >> If I checkout another branch and then ckecout our_branches, I got a \n> >> message telling my our_patches and the one from the server have \n> >> diverged (or you are two commits behind...).\n> >>\n> >> How can you get this info directly without leaving/rejoining your \n> >> branch?\n> > \n> > It is also part of \"git status\"' output.\n> \n> Is there some option to just get the status of HEAD against tracked \n> branch and not the index status? I guess I could do an alias but an \n> option would be nicer ;)\n\nJust try \"git checkout\".\n\nCiao,\nDscho\n"}]}