Here is a very good article on the subject (archived version here, with the relevant parts reproduced here):
Lets say you have a project named johndoe
with a file README
like below:
/var/www/html/johndoe/
/var/www/html/johndoe/README
Initialise an empty Git repository here:
$ cd /var/www/html/johndoe
$ git init
$ git add README
$ git commit README -m "Initial commit."
Change the directory to where your Google Drive is located and initialize a bare repository:
$ cd /Users/myusername/Google\ Drive/
$ mkdir johndoe
$ cd johndoe
$ git init --bare
Go back to your working directory:
$ cd /var/www/html/johndoe
$ git remote add origin file:///Users/myusername/Google\ Drive/johndoe
$ git push origin master
To clone your Git repository from Google Drive:
$ cd /var/www/html/johndoe2
$ git clone file:///Users/myusername/Google\ Drive/johndoe