How do I create a local svn repository and use XCode 4 to interface to it.

Discussion in 'Mac Programming' started by DonRobb, Oct 17, 2011.

  1. DonRobb macrumors newbie

    Joined:
    Oct 17, 2011
    #1
    I'm very new to Xcode 4. I would like to create a local svn repostory and use Xcode 4 to interface to it. In the past I have been a windows developer and am familar with svn and version control concepts. I have seen several tutorials. that all have to do with running svn server software on an actual server. Is this the only option for using XCode 4 with svn? In the windows eviroment I have always just used the menu's that get attached to the windows explorer when right clicking on folders when tortiose svn is installed. What I have usually done is create a repository on a shared mapped server drive and then I have been able to use my shared drive repository by entering in file:///pathtorepository as the url to the repository. Is there a way to do something similar on Mac with Xcode 4? Thanks to anyone who has a good answer or can point me to the documentation or a good tutorial that shows how to do this if it is possibe.

    Kind regards,
    Don
     
  2. szymczyk macrumors regular

    Joined:
    Mar 5, 2006
    #2
    If you're going to create a local repository with Xcode 4, I recommend using git. When you create a new project and pick a location to save the project, there is a checkbox to create a local git repository. That's the easiest way to create a local repository in Xcode 4.

    If you want to use Subversion instead of git, open the Terminal and run the svnadmin create command to create the local repository. In Xcode open the Organizer and click the Repositories button at the top of the window. On the left side of the Organizer is a repository list. If the repository you created isn't in the list, click the + button in the lower left corner of the Organizer and choose Add Repository. From there you can name the repository and specify its location.
     
  3. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #3
    Yes, that is pretty much what you do, you run SVN on a server. But, remember that your Mac OS X system is a UNIX server (that just happens to be running a pretty desktop program). You can set up svn on the Mac just the same way you'd set up svn on a Linux or BSD machine. Use "svnadmin create" from a terminal window
     
  4. DonRobb, Oct 17, 2011
    Last edited by a moderator: Oct 17, 2011

    DonRobb thread starter macrumors newbie

    Joined:
    Oct 17, 2011
    #4
    I followed your second set up instructions with regard to using Subversion instead of git. I ran svnadmin create in a local folder where I want to put my repository. All the nescessary file got created. In Xcode I opened the organizer, clicked repositories. I clicked the + button and chose Add Repository. I supplied the path but in won't connect. This is the full path I specified for the location of the repository

    file:///Alfred's MacBook Pro/Macintosh HD/Users/alfredzeuner/Desktop/repo/repo

    and is where I exectured the svnadmin create. It just won't connect. I get the red icon that shows that xcode is not connected to it. I'm a little new to Mac stuff. Am I supplying the path correctly typed as you see. Can you suggest what I might be doing wrong.
     
  5. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #5
    I think you're supposed to escape the spaces in your path with backslashes '\'
    You might wan't to try it with the spaces escaped to see if it works.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    Try this:
    Code:
    file:///Users/alfredzeuner/Desktop/repo/repo
    
    or maybe this:
    Code:
    file:///Users/alfredzeuner/Desktop/repo
    

    I don't know what observations or reasoning you applied to get this:
    Code:
    file:///Alfred's MacBook Pro/Macintosh HD/Users/alfredzeuner/Desktop/repo/repo
    
    but it might be good to explain how you arrived at that path.

    A file URL needs a Posix-style path, not a "computer name + hard drive name + folder" path.
     
  7. DonRobb thread starter macrumors newbie

    Joined:
    Oct 17, 2011
    #7
    Thanks very much for your advice but I'm afraid it still won't connect

    file:///Alfred's\ MacBook\ Pro/Macintosh\ HD/Users/alfredzeuner/Desktop/repo/repo

    Am I correct by putting file:/// in front of the path? Not to be a pain but would you mind giving it a try and seeing if you can ever get a local repository to connect in this way? I was looking at some other posts where people have had a problem. Would you mind seeing if you can make it work on your system just so I have confirmation that someone has seen this work.
    I can't seem to confirm whether or not this is a bug in Xcode 4. I am very greatful for your help. I've seen other posts where people have talked about this problem but can't find any confirmation that it works.
     
  8. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #8
    Read chown33s' post again. You didn't get it.
     
  9. DonRobb, Oct 17, 2011
    Last edited by a moderator: Oct 17, 2011

    DonRobb thread starter macrumors newbie

    Joined:
    Oct 17, 2011
    #9

    Thankyou so much for your help.

    file:///Users/alfredzeuner/Desktop/repo/repo

    was the solution.
    I was even able to import a project to the repositoy after clicking root, choosing import and then broswign to my project path. I am very greatful!
     

Share This Page