More Git for xcode Development with 1and1 Hosting Service

By July 12, 2012 February 18th, 2015 IT Stuffs

I am still using my 1and1 provider to host my git repositories. It has been working very well and I have some additional useful tips for working on your xcode developments on multiple computers.

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

How to PULL your repository the first time on your 2nd OSX machine

This is actually very simple. All your have to do is to create a folder where you want your codes to pull to and use the “git clone” to get your data. Here is how:

  • Go to your 2nd Mac, your development folder (ex. ~/Documents/dev), create a same project folder name such as “proj1” by using this command in the terminal “mkdir proj1″
  • “cd proj1” to go to your project folder
  • now do “git clone ssh://” to clone your git repository over to your second Mac machine.

Where the path “kunden/homepages/99/d999999999/htdocs/” is your actual full path under 1and1. To find out what your full path is, 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.

How to access git branch on the 2nd PC?

This is not as hard as you think either, just need to know how to do it. Go ahead and open up a terminal on your second PC, go to your project folder and use the following commands:

  • cd ~/Documents/dev/proj1
  • git branch
    • this most likely only displayed “* master”
  • git branch -a
    • now this will show all the braches. Make a note the branch name you would like to use on your 2nd PC. For example: branch1
  • git checkout -b branch1 origin/branch1
    • now the branch1 is checked out and you are using it. When you do “git branch” again, you should see “*” right next to “branch1” now.

This is it. Now open up xcode and you can see it is using the branch you want.

Leave a Reply