This is just a quick post. Mainly more for me so I can look it up later :)

To sync between a git repo and a origin that you setup on your google drive folder follow these steps:

1. Go to your google drive folder and add a folder for your git repos. I use Git.
2. Create your git repo folder under that. (call it reponame.git)
3. Open git cmd and navigate to that folder and type git init –bare
4. Copy the full path to that location (c:\users\username\Google Drive\Git\reponame.git
5. Go to the folder you have your code in say c:\projects\myproject
6. Initialise it with git init
7. Add the files to the repo with git add .
8. Check the files in with git commit -m “Commit message”
9. Add the remote with git remote add origin /C/Users/username/Google\ Drive/Git/reponame.git
10. Push your changes to the remote with git push origin master

Your done.

No you can setup git repos on other machines and just do a git pull on it and your all done.


About these ads