was successfully added to your cart.

Setup Git for xcode Development with 1and1 Web Hosting Service

By October 21, 2011IT Stuffs

I was using github.com as my iPhone development repositories. However, the github free version put all my codes to public and I am getting uncomfortable with it. At the same time, I don’t feel like spending monthly fee to subscribe to github’s private repository. After some digging, I found 1and1 hosting actually support git. Cool~! After some tries, I was able to make it work! Here is how:

  • login to your 1and1 account by going to http://admin.1and1.com
  • make sure you have “Git” under “Domains and Web Space” –> “Web Space”.
  • Click on “Git” and then click on “SSH Access” button. You should setup a SSH account if you don’t have one yet, or write down your SSH username (ex. u22222) and make sure your password is correct.
  • Now, open a terminal under OSX and ssh into your web site. Here is an example –> ssh -l u22222 www.vkick.com
  • Once you are logged in, do the followings under 1and1
    • create a .ssh folder if you don’t have one yet –> mkdir ~/.ssh (This is where we will copy your workstation public key to)
    • create a folder to place all your git repositories –> mkdir ~/git-repo
    • create a folder to place your project –> mkdir ~/git-repo/proj1
    • initialize it for git –> cd ~/git-repo/proj1; git –bare init
  • On your OSX workstation, open another terminal session to copy your public key to your 1and1 hosting. If you haven’t made your RSA public/private key yet, please follow the steps in my pervious blog: xcode 4.1 with github for Version Control and Co-Development under Prepare Your RSA Public/Private Key for Your Workstation section.
scp ~/.ssh/id_rsa.pub u22222@www.vkick.com:~/.ssh/authorized_keys
  • now, go to where your saved your xcode project to setup git remote. Here is an example:
cd ~/Documents/XCODE-PROJ/proj1
git remote rm origin
git init
git remote add origin u22222@www.vkick.com:git-repo/proj
git push origin master

“git remote rm” is to remove “origin” in case you perviously set it up with github. For “git remote”, u22222 is your 1and1 SSH username, then the 1and1 URL, and then the path where your plan to place your project.

That’s all. You should be able to do a PUSH in your xcode now.

 

Join the discussion 5 Comments

  • julien says:

    thanks for this.
    I didn’t even know I had that option on my 1and1 subscriptions 🙂

    It would be nice to use a tool to graph & gui git on 1and1 stuff to have a “kind of” web view.

  • vkick says:

    Few people were asking what are the procedures to setup another Mac machine to access and pull git repository the first time. The answer is by using “git clone” command. Here is how:

    1. Go to your 2nd Mac, your development folder (ex. ~/Documents/dev), create a same project folder name such as “mkdir proj1”
    2. cd proj1
    3. git clone ssh://u22222@www.vkick.com/kunden/homepages/99/d999999999/htdocs/git-repo/proj

    Where the path “kunden/homepages/99/d999999999/htdocs/” is your actual full path under 1and1. To find out your full path, just use “pwd” command when you ssh into your 1and1 account.

    Once it got cloned the first time, you can open your Xcode, access your codes, and do PUSH as needed.

    Hope this help.

  • […] For the basic “how-to” setup the first time, please read my “Setup Git xcode Devlopment with 1and1 Web Hosting Service“ […]

  • teapigs says:

    This is actually attention-grabbing, You’re an extremely skilled blogger. I’ve joined up with your current feast and check ahead for you to inside seek out really your own fantastic posting. As well, I’ve got embraced your blog during my social support systems

  • […] For the basic “how-to” setup the first time, please read my “Setup Git xcode Devlopment with 1and1 Web Hosting Service” […]

Leave a Reply