{"thread":{"id":"13600","subject":"Using git to perform merges between SVN branches","startedAt":"2008-05-21T15:50:33Z","lastAt":"2008-05-21T18:01:40Z","messageCount":2,"participants":["davetron5000","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77395","messageId":"a5c338c9-7820-41bd-a3a3-36ba5aad4379@l64g2000hse.googlegroups.com","threadId":"13600","inReplyTo":null,"subject":"Using git to perform merges between SVN branches","fromName":"davetron5000","fromEmail":"davetron5000@gmail.com","sentAt":"2008-05-21T15:50:33Z","receivedAt":"2008-05-21T15:50:33Z","isPatch":false,"sender":{"key":"davetron5000@gmail.com","avatar":"https://gravatar.com/avatar/9ec09086e36c4e609dfc23a4582d2c7adf7dc2fb1796f74492d52727efa6ba86?d=mp&s=160"},"body":"Working out of an SVN/subversion repository.  Initially cloned it so I\ncould work with git via git-svn.  I was given a branch in svn to work\non.  Created local branches connected to the main trunk and my branch\nvia:\n\ngit-checkout -b local-trunk trunk\ngit branch local-foo FOO\n\nwhere svn_root/branches/FOO is where I'm to commit changes\n\ncommits work fine, etc.\n\nWhat I'd like to do, for simplicity, and as a demonstration of git's\nsuperior merging, is to do the merge of my code to the main trunk\nusing git.  My main concern is not getting into a situation where I\ncannot commit to svn (since it doesn't track merges)\n\nWould something like this work:\n\ngit checkout local-trunk\ngit-svn rebase\ngit checkout -b merge-foo local-trunk\ngit merge local-foo\n# Resolve conflicts, etc.  local-foo now has what should go onto SVN's\ntrunk\ngit checkout local-trunk\ngit merge merge-foo\n# this should work without any conflicts, since I resolved them on\nmerge-foo\ngit-svn dcommit\n# Now I've merged my changes to the main trunk\n\nThanks,\n\nDave\n"},{"id":"77401","messageId":"20080521180140.GA21231@atjola.homenet","threadId":"13600","inReplyTo":"a5c338c9-7820-41bd-a3a3-36ba5aad4379@l64g2000hse.googlegroups.com","subject":"Re: Using git to perform merges between SVN branches","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-05-21T18:01:40Z","receivedAt":"2008-05-21T18:01:40Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.05.21 08:50:33 -0700, davetron5000 wrote:\n> Working out of an SVN/subversion repository.  Initially cloned it so I\n> could work with git via git-svn.  I was given a branch in svn to work\n> on.  Created local branches connected to the main trunk and my branch\n> via:\n> \n> git-checkout -b local-trunk trunk\n> git branch local-foo FOO\n> \n> where svn_root/branches/FOO is where I'm to commit changes\n> \n> commits work fine, etc.\n> \n> What I'd like to do, for simplicity, and as a demonstration of git's\n> superior merging, is to do the merge of my code to the main trunk\n> using git.  My main concern is not getting into a situation where I\n> cannot commit to svn (since it doesn't track merges)\n> \n> Would something like this work:\n> \n> git checkout local-trunk\n> git-svn rebase\n> git checkout -b merge-foo local-trunk\n> git merge local-foo\n> # Resolve conflicts, etc.  local-foo now has what should go onto SVN's\n> trunk\n> git checkout local-trunk\n> git merge merge-foo\n> # this should work without any conflicts, since I resolved them on\n> merge-foo\n> git-svn dcommit\n> # Now I've merged my changes to the main trunk\n\nYou can skip the whole merge-foo thing and just merge local-foo into\nlocal-trunk, the second merge would end-up as a fast-forward anyway.\n\nThat said, the above should work, given that a) you don't do any\nrebasing after merging and b) the merge commit is the first commit that\ngets dcommitted to svn.\n\nI don't remember what happens when there are new revisions in svn since\nyou last ran \"git svn rebase\", so you might want to try that case on a\nthrow-away svn repo first.\n\nWhat SVN will see is basically what git would see had you done a \"merge\n--squash\", but git will retain the merge information (big plus!).\n\nBjörn\n"}]}