{"thread":{"id":"27339","subject":"fast forward a branch from another","startedAt":"2011-05-12T14:40:16Z","lastAt":"2011-05-12T16:58:32Z","messageCount":7,"participants":["Eric Frederich","Michael J Gruber","Junio C Hamano","Phil Hord"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"167735","messageId":"BANLkTi=PtkDp8PNdMNi3hTwHPjFg+Jtftw@mail.gmail.com","threadId":"27339","inReplyTo":null,"subject":"fast forward a branch from another","fromName":"Eric Frederich","fromEmail":"eric.frederich@gmail.com","sentAt":"2011-05-12T14:40:16Z","receivedAt":"2011-05-12T14:40:16Z","isPatch":false,"sender":{"key":"eric.frederich@gmail.com","avatar":"https://gravatar.com/avatar/a047bc6d3404a87c923025574cdee9abf57ae9efc1d96c7bbedf30faf47ee12c?d=mp&s=160"},"body":"Often times I get into a situation where I have a \"development\" branch\nthat gets ahead of say a \"stable\" branch.\nWhen I am ready to call the development branch stable this is what I do.\n\n$ git checkout stable\n$ git merge development\n$ git checkout development\n\nThe problem here is that the act of going backwards (via checking out\nstable) really messes up my IDE and or Text editors.\nIs there any way to do this without switching branches, which modifies\nmy working directory, which messes up my IDE?\n\nThanks,\n~Eric\n"},{"id":"167739","messageId":"4DCBFD55.9050005@fastmail.fm","threadId":"27339","inReplyTo":"BANLkTi=PtkDp8PNdMNi3hTwHPjFg+Jtftw@mail.gmail.com","subject":"Re: fast forward a branch from another","fromName":"Michael J Gruber","fromEmail":"michaeljgruber+moznews@fastmail.fm","sentAt":"2011-05-12T15:31:33Z","receivedAt":"2011-05-12T15:31:33Z","isPatch":false,"sender":{"key":"michaeljgruber+moznews@fastmail.fm","avatar":null},"body":"Eric Frederich venit, vidit, dixit 12.05.2011 16:40:\n> Often times I get into a situation where I have a \"development\" branch\n> that gets ahead of say a \"stable\" branch.\n> When I am ready to call the development branch stable this is what I do.\n> \n> $ git checkout stable\n> $ git merge development\n> $ git checkout development\n> \n> The problem here is that the act of going backwards (via checking out\n> stable) really messes up my IDE and or Text editors.\n> Is there any way to do this without switching branches, which modifies\n> my working directory, which messes up my IDE?\n\nI assume this is a ff-situation, i.e. stable is fully contained in\ndevelopement? then you can reset branch stable like this:\n\ntest 0 -eq $(git rev-list  --count ^development stable) && git branch -f\nstable development\n\n(I thought you could git rev-list --quiet but I'm too dumb :|)\n\nMichael\n"},{"id":"167740","messageId":"4DCBFDE9.9060700@drmicha.warpmail.net","threadId":"27339","inReplyTo":"4DCBFD55.9050005@fastmail.fm","subject":"Re: fast forward a branch from another","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-05-12T15:34:01Z","receivedAt":"2011-05-12T15:34:01Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael J Gruber venit, vidit, dixit 12.05.2011 17:31:\n> Eric Frederich venit, vidit, dixit 12.05.2011 16:40:\n>> Often times I get into a situation where I have a \"development\" branch\n>> that gets ahead of say a \"stable\" branch.\n>> When I am ready to call the development branch stable this is what I do.\n>>\n>> $ git checkout stable\n>> $ git merge development\n>> $ git checkout development\n>>\n>> The problem here is that the act of going backwards (via checking out\n>> stable) really messes up my IDE and or Text editors.\n>> Is there any way to do this without switching branches, which modifies\n>> my working directory, which messes up my IDE?\n> \n> I assume this is a ff-situation, i.e. stable is fully contained in\n> developement? then you can reset branch stable like this:\n> \n> test 0 -eq $(git rev-list  --count ^development stable) && git branch -f\n> stable development\n> \n> (I thought you could git rev-list --quiet but I'm too dumb :|)\n\nIn fact, am I even too dumb to set my from address today. Sorry! Have to\ngive \"virtual identity\" another try...\n\nMichael\n"},{"id":"167742","messageId":"7vsjsjdhud.fsf@alter.siamese.dyndns.org","threadId":"27339","inReplyTo":"BANLkTi=PtkDp8PNdMNi3hTwHPjFg+Jtftw@mail.gmail.com","subject":"Re: fast forward a branch from another","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-12T16:06:02Z","receivedAt":"2011-05-12T16:06:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Frederich <eric.frederich@gmail.com> writes:\n\n> Often times I get into a situation where I have a \"development\" branch\n> that gets ahead of say a \"stable\" branch.\n> When I am ready to call the development branch stable this is what I do.\n>\n> $ git checkout stable\n> $ git merge development\n> $ git checkout development\n\nInstead of switching to \"stable\", while still on the development, you\ncould do\n\n\t$ git push . HEAD:stable\n\nwhich would succeed only when you are purely ahead of stable (otherwise it\nwill fail as you are not forcing).\n"},{"id":"167744","messageId":"4DCC0A4F.7000800@cisco.com","threadId":"27339","inReplyTo":"7vsjsjdhud.fsf@alter.siamese.dyndns.org","subject":"Re: fast forward a branch from another","fromName":"Phil Hord","fromEmail":"hordp@cisco.com","sentAt":"2011-05-12T16:26:55Z","receivedAt":"2011-05-12T16:26:55Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"\nOn 05/12/2011 12:06 PM, Junio C Hamano wrote:\n> [...]\n> Instead of switching to \"stable\", while still on the development, you\n> could do\n>\n> \t$ git push . HEAD:stable\n>\n> which would succeed only when you are purely ahead of stable (otherwise it\n> will fail as you are not forcing).\n>\n\nWow!  Another gem. I didn't realize you could use 'dot' to refer to the\nsame repo you're in.\n\nI don't see this feature listed in the git push [REMOTES] section.  Is\nit documented somewhere else?\n\nPhil\n"},{"id":"167746","messageId":"7vfwojdfta.fsf@alter.siamese.dyndns.org","threadId":"27339","inReplyTo":"4DCC0A4F.7000800@cisco.com","subject":"Re: fast forward a branch from another","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-12T16:49:53Z","receivedAt":"2011-05-12T16:49:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phil Hord <hordp@cisco.com> writes:\n\n> I don't see this feature listed in the git push [REMOTES] section.  Is\n> it documented somewhere else?\n\nBoth \"git help push\" and \"git help pull\" will tell you in the \"Git URLs\"\nsection that a local file path is a way to name a repository.  Therefore,\nyou can say \"git ls-remote $(pwd)\" to list the the refs from the current\nrepository. If you are in git.git directory, \"git ls-remote ../git.git\"\ndoes the same thing, so does \"git ls-remote .\".\n\nThese are merely specializations of more general \"git push $path $refspec\"\nand nothing noteworthy.\n"},{"id":"167747","messageId":"4DCC11B8.8000805@cisco.com","threadId":"27339","inReplyTo":"7vfwojdfta.fsf@alter.siamese.dyndns.org","subject":"Re: fast forward a branch from another","fromName":"Phil Hord","fromEmail":"hordp@cisco.com","sentAt":"2011-05-12T16:58:32Z","receivedAt":"2011-05-12T16:58:32Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"\nOn 05/12/2011 12:49 PM, Junio C Hamano wrote:\n> Phil Hord <hordp@cisco.com> writes:\n>\n>> I don't see this feature listed in the git push [REMOTES] section.  Is\n>> it documented somewhere else?\n> Both \"git help push\" and \"git help pull\" will tell you in the \"Git URLs\"\n> section that a local file path is a way to name a repository.  Therefore,\n> you can say \"git ls-remote $(pwd)\" to list the the refs from the current\n> repository. If you are in git.git directory, \"git ls-remote ../git.git\"\n> does the same thing, so does \"git ls-remote .\".\n>\n> These are merely specializations of more general \"git push $path $refspec\"\n> and nothing noteworthy.\n\nThanks for pointing out the obvious to me.  I guess I was thinking of it\nas a parallel to '-', as in 'git checkout -', and simultaneously\ndistracted by the surprise realization that one can push from/to the\nself-same repository.\n\nPhil\n"}]}