Ruby on Rails 项目的哪些部分应签入存储库?

发布于 2024-11-05 17:20:41 字数 1231 浏览 0 评论 0原文

我正在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

淡淡的优雅 2024-11-12 17:20:41

Gemfile.lock 必须签入!

忽略

  • tmp/
  • db/*.sqlite
  • public/system/*
  • log/*

Gemfile.lock MUST be checked in!

Ignore

  • tmp/
  • db/*.sqlite
  • public/system/*
  • log/*
橘寄 2024-11-12 17:20:41

我相信你应该忽略

  • tmp/.
  • db/*.sqlite
  • public/assets(system etc - Attaches)
  • log/*

编辑

@normalocity 写道:
任何包含敏感信息的文件(特别是如果代码存储库位于公共场所,例如 Git)。例如,我有一个应用程序将我的 SMTP 服务器密码存储在文件中,以便我的应用程序可以发送电子邮件。但是,包含该密码的文件不包含在我的存储库中。如果文件发生更改,我会手动安全复制它(这种情况极其罕见,在我的情况下,当我的测试套件失败时,这种情况很明显)。 – 常态

I believe you should ignore

  • tmp/.
  • db/*.sqlite
  • public/assets(system etc - attaches)
  • log/*

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

一城柳絮吹成雪 2024-11-12 17:20:41

这是一个很好的指南:http://railscasts.com/episodes/36-subversion-on -rails

你基本上想忽略这些文件:

  • log/*
  • tmp/*
  • config/database.yml

This is a good guide: http://railscasts.com/episodes/36-subversion-on-rails

You basically want to ignore these files:

  • log/*
  • tmp/*
  • config/database.yml
抹茶夏天i‖ 2024-11-12 17:20:41

Rails 3 项目默认忽略这些文件(对于 Git,但对于任何 VCS 都应该相同):

.bundle
db/*.sqlite3
log/*.log
tmp/

我建议您将 Gemfile.lock 保留在存储库中。如果其他人正在从事同一个项目,它将保证每个人都使用每个 gem 的完全相同的版本。请参阅此处了解更多信息。

Rails 3 projects defaults to ignore these files (for Git, but it should be the same for any VCS):

.bundle
db/*.sqlite3
log/*.log
tmp/

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文