使用Git保存我的应用程序的公共和私有版本 [英] Keeping a public and private version of my app using Git

查看:105
本文介绍了使用Git保存我的应用程序的公共和私有版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个使用Git管理的Rails应用程序。一切都很完美,但我想保留一个公开的版本以及一个私人的版本。即:


  • 公共版本用于公共存储库(供人们使用),

  • 和私人版本是为我自己的网站。



这个想法是两个版本都应该是最新的,不同的是我的私人版本的文件包含我网站的密码,并且公共版本不包含(或包含一些默认值)。



我一直在考虑分支: master code>(公共版本)和一些私人的。

但是似乎我必须在每次提交后进行大量合并。



请记住,我要求我在git上还是个不错的选择。



谢谢大家!

解决方案

我做Django开发并将所有敏感数据保存在一个单独的文件中,并放入我的 .gitignore 。它不受版本控制,我在我的部署服务器和本地开发机器上保留了这些版本。


I am building a Rails app that I manage with Git. All is perfect, but I'd like keep a public version as well as a private one. That is:

  • the public version is for a public repository (for people to use),
  • and the private version is for my own site.

The idea is that both versions should be up-to-date, with the difference that my private version's files contain passwords for my site, and the public version doesn't (or contains some default values as such).

I've been thinking of branches: master (the public version) and some private one.
But it seems that I'd have to do a lot of merging after each commit.

Please, bear in mind, that I am a asking for I am still quite a noob at git.

Thanks folks!

解决方案

I do Django development and keep all my sensitive data inside a single file which I put inside my .gitignore. It's not version controlled and I keep separate versions of this on my deployment server and local dev machine.

这篇关于使用Git保存我的应用程序的公共和私有版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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