{"thread":{"id":"16192","subject":"Workflow for sharing changes on top of often-rebased work","startedAt":"2008-11-06T01:57:58Z","lastAt":"2008-11-06T01:57:58Z","messageCount":1,"participants":["Mike Mazur"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95022","messageId":"20081106105758.7107a801@sumo","threadId":"16192","inReplyTo":null,"subject":"Workflow for sharing changes on top of often-rebased work","fromName":"Mike Mazur","fromEmail":"mmazur@gmail.com","sentAt":"2008-11-06T01:57:58Z","receivedAt":"2008-11-06T01:57:58Z","isPatch":false,"sender":{"key":"mmazur@gmail.com","avatar":null},"body":"Hi,\n\nI have a set of changes on top of an SVN tree I'm tracking with git.\nThe SVN changes regularly, and I like to keep my changes up-to-date as\nwell. The branch containing my changes lives on my workstation, but\nalso in a remote repo so I can also work from my laptop, and others can\nlook at my work.\n\nHere's my current workflow:\n\nFirst, I clone the SVN repo on my workstation:\n\n$ git svn clone ssh://remote/svn repo\n$ cd repo\n\nI then created a bare repo on a server (git://remote/repo) which is how\nI share my changes between my workstation, laptop, and others. In my\nrepo, I add this remote location as origin. Occasionally I will rebase\nmy master against SVN and push this to the server:\n\n$ git remote add origin git://remote/repo\n$ git remote update\n$ git checkout master\n$ git svn rebase\n$ git push origin master:master\n\nNow, to do my work, I made a branch based on master in which my changes\nwill live:\n\n$ git branch my_work master\n$ git checkout my_work\n\nThen I hack away and have a bunch of commits. I publish this branch on\nmy server:\n\n$ git checkout my_work\n$ git push origin my_work # create branch my_work in git://remote/repo\n\nEventually, I'd like to rebase this work on top of the latest SVN\nrevision. First I update my master branch against SVN:\n\n$ git checkout master\n$ git svn rebase\n$ git push origin master:master\n\nAnd then I rebase my work on top of that:\n\n$ git checkout my_work\n$ git rebase master\n# resolve conflicts\n$ git rebase --continue\n\nAt this point, I'd like to push my_work to the server:\n\n$ git checkout my_work\n$ git push origin my_work:my_work\nTo git://remote/repo\n ! [rejected]        my_work -> my_work (non-fast forward)\nerror: failed to push some refs to 'git://remote/repo'\n\nWhat's the proper way to do this?\n\nI've read a few threads in the archives and came across an email by\nJunio[1] that shows how using `git push --force` and setting\n\"receive.denynonfastforwards = false\" on the remote repo will allow me\nto push these changes. Is this the best way forward? If it is, how do I\n(or others) update the my_work branch after a non-fast forward push to\nthe remote repo?\n\nYour insights greatly appreciated!\nMike\n\n\n[1] http://marc.info/?l=git&m=119540948816950&w=2\n"}]}