Init Git repository on my Google Drive

Some GIT basics mainly for me to remember. I use Google Drive as a poor man solution to share some Java test projects between my work place and my home. And that's how I have done it.

First, init the (local) repository at Google Drive. On MacOS, the directory can be found at ~/Google\ Drive/:

cd ~/Google\ Drive/
mkdir projects
cd projects
mkdir my_project.git
cd my_project.git
git init --bare

In the test project workspace, a project is added to the repository as follows:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin ~/Google\ Drive/projects/my_project.git
git push -u origin master

Now the project can be cloned:

git clone ~/Google\ Drive/projects/my_project.git
cd my_project

That's it.

Original post: http://peter-on-java.blogspot.com/2014/06/init-git-repository-on-my-google-drive.html

Tags vcs macos