如何同时使用Git和Dropbox? [英] How to use Git and Dropbox together?

查看:91
本文介绍了如何同时使用Git和Dropbox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Git Dropbox 一起?

推荐答案

我认为Dropbox上的Git很棒。我用它所有的时间。我有多台计算机(两台在家中,一台在工作中),在其中我将Dropbox用作中央裸仓库。由于我不想将其托管在公共服务上,而且我无法访问始终可以通过SSH进行连接的服务器,因此Dropbox通过在后台同步(非常快)来解决此问题。

I think that Git on Dropbox is great. I use it all the time. I have multiple computers (two at home and one at work) on which I use Dropbox as a central bare repository. Since I don’t want to host it on a public service, and I don’t have access to a server that I can always SSH to, Dropbox takes care of this by syncing in the background (very doing so quickly).

设置是这样的:

~/project $ git init
~/project $ git add .
~/project $ git commit -m "first commit"
~/project $ cd ~/Dropbox/git

~/Dropbox/git $ git init --bare project.git
~/Dropbox/git $ cd ~/project

~/project $ git remote add origin ~/Dropbox/git/project.git
~/project $ git push -u origin master

从那里,您可以仅克隆〜/ Dropbox / git / project.git 目录(无论是否属于您的Dropbox帐户或在多个帐户之间共享)并执行所有正常的Git操作-它们将自动同步到您的所有其他计算机。

From there, you can just clone that ~/Dropbox/git/project.git directory (regardless of whether it belongs to your Dropbox account or is shared across multiple accounts) and do all the normal Git operations—they will be synchronized to all your other machines automatically.

我写了一篇博客文章 关于版本控制,其中介绍了环境设置背后的原因。它基于我的 Ruby on Rails 开发经验,但实际上它可以应用于任何事物。

I wrote a blog post "On Version Control" in which I cover the reasoning behind my environment setup. It’s based on my Ruby on Rails development experience, but it can be applied to anything, really.

这篇关于如何同时使用Git和Dropbox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆