{"thread":{"id":"26717","subject":"rebase question","startedAt":"2011-03-11T19:57:25Z","lastAt":"2011-03-13T01:05:32Z","messageCount":2,"participants":["Ryan Sun","Martin von Zweigbergk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163243","messageId":"AANLkTi=8Q+gNSY2jzgMMtPX-JHUy4MUEGNTeK85Ddvys@mail.gmail.com","threadId":"26717","inReplyTo":null,"subject":"rebase question","fromName":"Ryan Sun","fromEmail":"ryansun81@gmail.com","sentAt":"2011-03-11T19:57:25Z","receivedAt":"2011-03-11T19:57:25Z","isPatch":false,"sender":{"key":"ryansun81@gmail.com","avatar":null},"body":"I want to rebase the current branch B1 from origin/A1 to origin/A2\nso I want to use this command\ngit --onto origin/A2 origin/A1 B1\n\nQ1: is this command right? (A2 is based on A1, current branch is B1,\nB1 is already pushed to origin, a remote repo, and I think I will\nforce push B1 after rebase)\n\nbut I accidentally typed\n git --onto origin/A2 origin/A1 origin/A2\nand git says\n----\nFirst, rewinding head to replay your work on top of it...\nFast-forwarded origin/base to origin/base.\n----\n\nQ2:I assume this command is safe and it didn't change anything right?\n\nTHANKS IN ADVANCE\n"},{"id":"163272","messageId":"alpine.DEB.2.00.1103121714280.15442@debian","threadId":"26717","inReplyTo":"AANLkTi=8Q+gNSY2jzgMMtPX-JHUy4MUEGNTeK85Ddvys@mail.gmail.com","subject":"Re: rebase question","fromName":"Martin von Zweigbergk","fromEmail":"martin.von.zweigbergk@gmail.com","sentAt":"2011-03-13T01:05:32Z","receivedAt":"2011-03-13T01:05:32Z","isPatch":false,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"On Fri, 11 Mar 2011, Ryan Sun wrote:\n\n> I want to rebase the current branch B1 from origin/A1 to origin/A2\n> so I want to use this command\n> git --onto origin/A2 origin/A1 B1\n> \n> Q1: is this command right? (A2 is based on A1, current branch is B1,\n> B1 is already pushed to origin, a remote repo, and I think I will\n> force push B1 after rebase)\n\nYes, it is correct (except that the \"rebase\" is missing, of\ncourse). Since A2 is based on A1, you could even use \"git rebase\norigin/A2 B1\".\n\n> but I accidentally typed\n>  git --onto origin/A2 origin/A1 origin/A2\n> and git says\n> ----\n> First, rewinding head to replay your work on top of it...\n> Fast-forwarded origin/base to origin/base.\n> ----\n\nI assume \"origin/base\" is what you called \"origin/A2\" above. The\noutput is a bit confusing in this case.\n\nI tried \"git rebase [--onto origin/pu] origin/pu origin/master\". That\nprinted\n\nFast-forwarded origin/master to origin/pu.\n\nwhich is even incorrect. It didn't (and shouldn't) update\norigin/master, so it obviously shouldn't say that it did\neither. Should be easy enough to fix. I will have a look at that when\nI get some time.\n\n> Q2:I assume this command is safe and it didn't change anything right?\n\nIt detached your HEAD at origin/A2, but no commits, nor refs would\nhave been changed or lost. You can safely checkout out B1 again if you\nwant.\n\n\n/Martin\n"}]}