使用google drive或者dropbox来搭载git仓库

原帖地址:点我

How to use Google Drive or Dropbox to host your private Git repositories

This was something that I needed to do (for my own personal and private projects). While there are many ways out there to host your private repositories such as the awesome BitbucketGithub, etc, I was looking at much simpler solution just for myself. All I needed is a versioning system to keep my source codes.

In this tutorial I'm going to demonstrate how easy it is to host your own Git repositories in any of your preferred cloud providers. I chose Google Drivepersonally.

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 -"Initial commit."

Now for the fun part. Change directory to where your Google Drive is located and initialise a bare repository.

$  cd /Users/myusername/GoogleDrive/
$  mkdir johndoe
$  cd johndoe
$  git init --bare

Getting back to your working directory..

$  cd /var/www/html/johndoe
$  git remote add origin file:///Users/myusername/Google\ Drive/johndoe
$  git push origin master

Walla :)

Edit: How to clone your Git repository from Google Drive

I missed this part earlier, adding to this article..

$  cd /var/www/html/johndoe2
$  git clone file:///Users/myusername/Google\ Drive/johndoe

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值