Pages

Friday, June 13, 2014

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 I can clone the project:
git clone ~/Google\ Drive/projects/my_project.git
cd my_project

No comments:

Post a Comment