Ruby on Rails 项目的哪些部分应签入存储库?
我正在为 Ruby on Rails 项目设置一个新的源代码控制存储库。我正在使用 Mercurial,我想知道要签入本地目录的哪一部分。
我在项目工作区中本地设置它的方式是以下文件结构:
drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 app
drwxr-xr-x 5 agenadinik agenadinik 4096 2011-04-27 09:58 config
-rw-r--r-- 1 agenadinik agenadinik 154 2011-04-27 09:58 config.ru
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-29 14:12 db
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 doc
-rwxrwxrwx 1 agenadinik agenadinik 781 2011-05-05 18:57 Gemfile
-rw-r--r-- 1 agenadinik agenadinik 1745 2011-05-05 18:57 Gemfile.lock
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 lib
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 log
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-05-02 17:16 mysql2
drwxr-xr-x 5 agenadinik agenadinik 4096 2011-04-29 13:17 public
-rw-r--r-- 1 agenadinik agenadinik 264 2011-04-27 09:58 Rakefile
-rw-r--r-- 1 agenadinik agenadinik 9126 2011-04-27 09:58 README
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 script
drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 test
drwxr-xr-x 6 agenadinik agenadinik 4096 2011-04-27 09:58 tmp
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 vendor
谢谢, 亚历克斯
I am setting up a new source control repository for a Ruby on Rails project. I am using Mercurial and I am wondering which part of my local directory to check in.
The way I have it set up locally in the project workspace is the following file structure:
drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 app
drwxr-xr-x 5 agenadinik agenadinik 4096 2011-04-27 09:58 config
-rw-r--r-- 1 agenadinik agenadinik 154 2011-04-27 09:58 config.ru
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-29 14:12 db
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 doc
-rwxrwxrwx 1 agenadinik agenadinik 781 2011-05-05 18:57 Gemfile
-rw-r--r-- 1 agenadinik agenadinik 1745 2011-05-05 18:57 Gemfile.lock
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 lib
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 log
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-05-02 17:16 mysql2
drwxr-xr-x 5 agenadinik agenadinik 4096 2011-04-29 13:17 public
-rw-r--r-- 1 agenadinik agenadinik 264 2011-04-27 09:58 Rakefile
-rw-r--r-- 1 agenadinik agenadinik 9126 2011-04-27 09:58 README
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 script
drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 test
drwxr-xr-x 6 agenadinik agenadinik 4096 2011-04-27 09:58 tmp
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 vendor
Thanks,
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Gemfile.lock 必须签入!
忽略
Gemfile.lock MUST be checked in!
Ignore
我相信你应该忽略
编辑
@normalocity 写道:
任何包含敏感信息的文件(特别是如果代码存储库位于公共场所,例如 Git)。例如,我有一个应用程序将我的 SMTP 服务器密码存储在文件中,以便我的应用程序可以发送电子邮件。但是,包含该密码的文件不包含在我的存储库中。如果文件发生更改,我会手动安全复制它(这种情况极其罕见,在我的情况下,当我的测试套件失败时,这种情况很明显)。 – 常态
I believe you should ignore
EDIT
@normalocity wrote:
Any any file that contains sensitive information (especially if the code repository is in a public place, such as Git). For example, I have an app that stores my SMTP server password in a file so my app can send email. The file that contains that password is NOT included in my repository, however. I secure-copy it by hand if there are changes to the file (which are extremely rare, and obvious when my test suite fails, in my case). – normalocity
这是一个很好的指南:http://railscasts.com/episodes/36-subversion-on -rails
你基本上想忽略这些文件:
This is a good guide: http://railscasts.com/episodes/36-subversion-on-rails
You basically want to ignore these files:
Rails 3 项目默认忽略这些文件(对于 Git,但对于任何 VCS 都应该相同):
我建议您将
Gemfile.lock
保留在存储库中。如果其他人正在从事同一个项目,它将保证每个人都使用每个 gem 的完全相同的版本。请参阅此处了解更多信息。Rails 3 projects defaults to ignore these files (for Git, but it should be the same for any VCS):
I would recommend that you DO keep your
Gemfile.lock
in your repository. If anyone else is working on the same project, it will guarantee that everyone is working with the exact same versions of each gem. See more here.