Archive

Posts Tagged ‘Mac’

Using a webdav git repository on Leopard

February 17th, 2009 No comments

This howto should clarify how to use git as a versioning system on a mac.  We use a git repository that has bee installed as described in my previous how to. This how to is strongly based on this kernel.org howto.

First we have to setup our environment, assuming that you have macports installed:

sudo port selfupdate
sudo port install git-core

Now we add our user and host to our .netrc file, to avoid repeated authentication:

vim ~/.netrc

Add the following information to this file:

machine <servername>
login <username>
password <password>

Now set the proper permissions:

chmod 600 ~/.netrc

Now we can create our local git repository, first we add a folder somewhere in our file system:

cd
cd Documents
mkdir my-new-repo.git
cd my-new-repo.git

Before we actually initialize our repository you can add some global info about you to the git environment:

git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com

You have to add some initial files, by copying them in to:

~/Documents/my-new-repo.git/

And now we initialize our git repository:

cd ~/Documents/my-new-repo.git
git init

Now we can add and commit our files into the repository, you may know this concept from svn:

git add .
git commit

And now the interesting part, interaction with the webdav server, first we have to configure the access:

git config remote.upload.url \

http://<username>@<servername>/my-new-repo.git/

Attention: Keep the trailing slash!

Now we can do the initial push, as you may have noticed commit didn’t send data to the server, as you would have expected it from svn for example. Instead push does.

git push upload master

Hey now there is some data on the server! But probably we want do get data from the server as well, here we can use the pull command:

git pull upload master

But it fails… we have to switch to the server and run the following command in the repository directory:

cd /var/www/my-new-repo.git
git-update-server-info
chown -R www-data.www-data ../my-new-repo.git

It’s a bit strange, but… why not. Now we can pull from our Mac:

git pull upload master

If you initialized the repository others can just clone it, this is an example of cloning:

cd
cd Documents
git clone http://<username>@<servername>/my-new-repo.git

A quick note, if you want to install git on Windows you can use msysgit on linux the setup should be almost the same.

Some Links
tortoisegit
Git on windows
Git on Windows (kerneltrap.org)

Time Machine and SMB

January 5th, 2009 No comments

I wanted to use my MacBook and Leopards Time Machine with an SMB share but  it could not find the shares, so I used google to finde the following hints, enter:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

into your Terminal. This will enable Time Machine to find network shares as well.

Now you have to create an image file, also via the Terminal:

hdiutil create -size 250G -fs HFS+J -type SPARSEBUNDLE -volname “SOMENAME” HOST_YOURMAC.sparsebundle

because the options where a bit confusing, here are the important details about this command:

-size 250G

The maximum size for our backup. The backup image will not get bigger than 250GB in this case.

-volname “SOMENAME”

You can enter any name you want for your backup, but avoid spaces and special characters.

HOST_YOURMAC.sparsebundle

HOST is the name of the Computer you want to backup. You can find this name via Sharing in your Preferences.

YOURMAC  is the mac adress of your en0 device. Enter:

ifconfig

into the Terminal, and search for ether in the en0 section. Enter the mac adress without colons.



Categories: Mac, MacBook Tags: , ,