English 中文(简体)
多机器编码
原标题:Coding on multiple machines

您将使用何种方法安全地使用多台机器在开发过程中进行代码工作?

My Ideal Situation

  • Sharing development code securely among multiple machines (at least two)
  • Automatic synchronization (think Google docs whereby any user s changes update all the others immediately). The reason for this is that I d like to be able to use these computers interchangeably without having to commit / clone every time I switch. My understanding is that automatic synchronization would make it possible to switch machines seamlessly without having to commit a bunch of files each time.
  • The location of the development code is such that it can be accessed by a local Rails server and rendered on localhost:3000.
  • The solution works for Apple machines (both my computers are Apple).

我不确定这个问题就其具体性而言是否合理,但这是我第一次作出最好的尝试。

最佳回答

如果您是唯一从事此工程工作的人, 那么像 https:// www. drotbox. com/" rel= "nofollow" > Dropbox 这样的服务将会有效, 并且会自动为您提供您之后的同步 。

但是,如果你在这个项目上与其他人合作,或者你将来可能这样做,那么值得学习Git的基本知识(或者其他的分布式版本控制系统)。

与 Git 同步不会是自动的, 但它确实给了你很多灵活性。

问题回答

使用任何版本控制系统( 假设 svn 和 growl 来通知) 。 如果您真的需要自动同步, 请在您的 crontab 中放置类似的东西 :

* * * * * cd /path/to/checkout; svn update && svn commit -m    || (echo "sync failed" |growlnotify )

我认为版本控制是代码共享方面最安全的最佳做法。

如果只有您在代码上工作, 您肯定可以设置另一个同步模式, 如自动同步投递文件夹 。

此外,如果假设是,在台式计算机上工作时,你的笔记本电脑总是可以访问的,你可以使用实际的笔记本电脑的代码位置作为桌面上的共享网络文件夹,所以不需要同步 :)

投放框是最好的免费且简单的解决办法。 我个人项目也使用它。 当您发送更改时, 只需小心在两台电脑上同时运行投放框, 而第二台只是运行投放框, 您可能会松开工作( 我的情况就是如此 ) 。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签