You already have git installed (as part os OSX)
- Open terminal
- got to the desired directory
clone the project:
Get a local copy of the repo repository with this command from either mirror location:
git clone https://android.googlesource.com/tools/repo
# OR:
git clone https://gerrit.googlesource.com/git-repo
also after downloading repo into ~/bin/repo what am I supposed to do?
I mean how to install that file.
The website has given few SHA keys but I don't know how to use them.
Follow those instructions:
http://source.android.com/source/downloading.html#installing-repo
What does those SHA-1 means?
For version 1.17, the SHA-1 checksum for repo is ddd79b6d5a7807e911b524cb223bc3544b661c28
For version 1.19, the SHA-1 checksum for repo is 92cbad8c880f697b58ed83e348d06619f8098e6c
For version 1.20, the SHA-1 checksum for repo is e197cb48ff4ddda4d11f23940d316e323b29671c
For version 1.21, the SHA-1 checksum for repo is b8bd1804f432ecf1bab730949c82b93b0fc5fede
For version 1.22, the SHA-1 checksum for repo is da0514e484f74648a890c0467d61ca415379f791
Those are the SHA-1 you have to checkout according to your version.
How to it?
Read here about the checkout part and do it:
How to move HEAD back to a previous location? (Detached head)