There are methods to sync my local git repository over to my google drive via google drive sync windows application, but I was wondering whether I could bypass its need alto
If you are running a Unix shell and have Google Drive locally installed on your machine, you can add a script to your .bash_profile or .zshrc file like this...
# Initialize a remote repo on "local" Google Drive and push to it for safekeeping.
function mkr() {
CWD=$(PWD)
REPONAME=${PWD##*/}
REPOPATH=/Users/Bob/Google\ Drive/Repos/$REPONAME
mkdir -p $REPOPATH
cd $REPOPATH
git init --bare
cd $CWD
git remote add origin $REPOPATH
git push origin master
}
Assuming you have already run git init, you can type mkr from the command line inside your local project directory. After this mkr step, you can run git push like normal as if it lives on GitHub, Bitbucket, etc. You just won't have the usual niceties from the remote side.