Did you follow:
http://source.android.com/download#TOC-Installing-Repo ?
All the steps should be there.
To install, initialize, and configure Repo, follow these steps:
1. Make sure you have a ~/bin directory in your home directory, and
check to be sure that this bin directory is in your path:
$ cd ~
$ mkdir bin
$ echo $PATH
2. Download the repo script and make sure it is executable:
$ >~/bin/repo
$ chmod a+x ~/bin/repo
I did this by doing the following:
# cd ~
# mkdir bin
# cd bin
# curl
https://android.git.kernel.org/repo > repo
# ls -ltr
-rw-r--r-- 1 root root 17211 Apr 15 23:19 repo
# chmod a+x repo
# ls -l
-rwxr-xr-x 1 root root 17211 Apr 15 23:19 repo
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
# which repo
/root/bin/repo
# repo -h
usage: repo COMMAND [ARGS]
repo is not yet installed. Use "repo init" to install it here.
The most commonly used repo commands are:
init Install repo in the current working directory
help Display detailed help on a command
For access to the full online help, install repo ("repo init").
I did this as root in this example, but I've also done this at work as
my user /home/username account.
Hope this helps....