I am trying to use git and MobileMe as a version control system for a personal project I am working across several computers. So far i have done the following.
Created and empty bare repository on my local computer
$ mkdir myproject.git
$ cd myproject.git
$ git init --bare
$ git update-server-info
I then copie开发者_如何学God the myproject.git
directory to the mobile me disk, and sync my computer with mobile me.
I then switched to the directory where my project was on my local machine, set the remote origin and try to push the local repository to mobile me
$ cd myproject
$ git remote add origin https://<username>@idisk.me.com/<username>/myproject.git/
$ git push --all
Im am then asked for my password twice. The first time is the mobile me password, any other password gets an error. After entering the second password, and believe me i've tried everything, terminal just hangs. So what am I doing wrong? (Besides trying to use mobileme as a git repository)
Thanks, Ben.
Forget what I tried before, if you want to use your MobileMe iDisk to store a bare repository, it is entirely possible.
The key is that you need to go into your MobileMe preferences, and under the iDisk tab, make sure that iDisk Sync is on, if it's not, start it. This creates a local copy of your iDisk that is accessible under the Volumes directory.
Then create a bare repository the same way you would on any other remote volume
$ cd /Volumes/iDisk
$ git init --bare myProject.git
You can then push/pull to this just as you would any other repository after you have added it as a remote
$ git remote add iDisk /Volumes/iDisk/myProject.git
$ git push iDisk master
To clone the repository, simply
$ git clone /Volumes/iDisk/myProject.git
It should be noted that you need to sync with mobile me before changes will take effect on other computers you are using mobile me with...
-Ben
I am not sure you can push through https, unless mobile me has somehow activated the git-http-backend cgi script, in order to better serve the right packfile.
(source: progit.org)
(See ProGit Book "smart http" section)
GitHub supports that protocol since April 2010, but I don't know about any other host providing that service yet.
精彩评论