Git/Mac

From eBabel wiki
Jump to: navigation, search

Tips for installing Git on Mac

Simple gotcha ... need to open new bash terminal after installing git

Basically installing git is really simple ... first google 'git mac download' ... click on 'http://git-scm.com/download/mac' ... then downloaded git-1.8.0.1-intel-universal-snow-leopard.dmg ... and lastly double click ;)

One small gotcha ... is that after install, I still couldn't see git binaries:

 $ which git
 $ 

The solution (from the readme.txt) was really simple

 Step 2 - Restart bash sessions
 ------------------------------
 This include GNU screen sessions, TMUX sessions, etc. 

so in a new terminal window, we can now see git executables:

 $ which git
 /usr/local/git/bin/git


Syncing xcats repository to Mac

git clone

After installing git, next simply run, the 'git clone' command

 $ which git
 /usr/local/git/bin/git
 $ git clone https://***@bitbucket.org/***/xcats.git
 Cloning into 'xcats'...
 remote: Counting objects: 60, done.
 remote: Compressing objects: 100% (59/59), done.
 remote: Total 60 (delta 23), reused 0 (delta 0)
 Unpacking objects: 100% (60/60), done.
 $ cd xcats
 $ ls -ltr
 total 48
 -rw-r--r--  1 euterpe  euterpe   1925 Dec  2 14:55 xcats.js
 -rw-r--r--  1 euterpe  euterpe  12077 Dec  2 14:55 index.htm
 -rw-r--r--  1 euterpe  euterpe    338 Dec  2 14:55 clickjacking.htm
 -rw-r--r--  1 euterpe  euterpe    210 Dec  2 14:55 README.md


Apache attempt 1 ... permission denied when try to symlink 'xcats repository html' file into 'apache server user directory'

double checking the syntax (critically the order of source_file and link):

 ln -s source_file my_new_link

so for /Users/euterpe/xcats/index.htm, I want to access this via /Users/euterpe/Sites/xcats.htm

 ln -s /Users/euterpe/xcats/index.htm /Users/euterpe/Sites/xcats.htm 

and double-checking:

 $ ls -l /Users/euterpe/Sites/xcats.htm 
 lrwxr-xr-x  1 euterpe  euterpe  30 Dec  2 15:15 /Users/euterpe/Sites/xcats.htm -> /Users/euterpe/xcats/index.htm

how trying to server this webpage:

 Forbidden
 You don't have permission to access /~euterpe/xcats.htm on this server.

which is odd as:

 $ ls -l /Users/euterpe/xcats/
 total 48
 -rw-r--r--  1 euterpe  euterpe    210 Dec  2 14:55 README.md
 -rw-r--r--  1 euterpe  euterpe    338 Dec  2 14:55 clickjacking.htm
 -rw-r--r--  1 euterpe  euterpe  12077 Dec  2 14:55 index.htm
 -rw-r--r--  1 euterpe  euterpe   1925 Dec  2 14:55 xcats.js

Apache attempt 2 ... copy file from 'local git repository' to 'apache server user directory'

This works  :

 $ mv /Users/euterpe/Sites/xcats.htm /Users/euterpe/Sites/xcats_sym_link.htm
 $ cp /Users/euterpe/xcats/index.htm /Users/euterpe/Sites/xcats.htm

but is a 'bit ugly' as we now have two copies of the html code (one under xcats repository and the other under apache working directory) ... and one we are running / testing is outside git!