Skip to contentSkip to conversation

Documentation: git-svn: fix example for centralized SVN clone

PATCH Superseded Jan Krüger 2 participants 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: git-svn: fix example for centralized SVN clone

The example that tells users how to centralize the effort of the initial git svn clone operation doesn't work properly. It uses rebase but that only works if HEAD exists. This adds one extra command to create a somewhat sensible HEAD that should work in all cases.

---
I have a feeling this looks a bit ugly, but I can't think of a simpler solution (especially since we're not fetching the central repo's HEAD). Still, it's certainly better than a broken example.

 Documentation/git-svn.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Documentation/git-svn.txt +2 -0
index 84c8f3c..ba94cd1 100644
@@ -544,6 +544,8 @@ have each person clone that repository with 'git-clone':
        git remote add origin server:/pub/project
        git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
        git fetch
+# Create a local branch from one of the branches just fetched
+       git checkout -b master FETCH_HEAD
 # Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server)
        git svn init http://svn.example.com/project
 # Pull the latest changes from Subversion

--
1.6.0.3.578.g6a50

#1 lore raw
Quoted 10 lines · Jan Krüger

The example that tells users how to centralize the effort of the initial git svn clone operation doesn't work properly. It uses rebase but that only works if HEAD exists. This adds one extra command to create a somewhat sensible HEAD that should work in all cases.

---
I have a feeling this looks a bit ugly, but I can't think of a simpler solution (especially since we're not fetching the central repo's HEAD). Still, it's certainly better than a broken example.

*shrug* Seems alright with me.

Adam wrote the original example, maybe he knows better.

Quoted 18 lines
 Documentation/git-svn.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Documentation/git-svn.txt +2 -1
index 84c8f3c..ba94cd1 100644
@@ -544,6 +544,8 @@ have each person clone that repository with 'git-clone':
        git remote add origin server:/pub/project
        git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
        git fetch
+# Create a local branch from one of the branches just fetched
+       git checkout -b master FETCH_HEAD
 # Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server)
        git svn init http://svn.example.com/project
 # Pull the latest changes from Subversion
--

1.6.0.3.578.g6a50

Signature · 1 line
Eric Wong