开发者

first time pushing to github

I have a rails 3 application in local. I created reposority and i know the basics of git like git. I am using git for heroku but i haven't push my application to public place before. What i want to learn is :

  1. Which files should i add to git ignore? Because i have some personal passwords and keys in environments.rb and also have some keys in init开发者_开发技巧ializers.
  2. If i add some files in git ignore, i guess it will be a problem for people who clones it, because some files will be missing.
  3. I will also keep on working on my application, i can always add new keys to environment.rb or somewhere else. Do i have to clone(branch) my application? I heard something "branch, master" but i have no idea about these terms?


The idea of gitignore is that often there are temporary files, or files that are specific to your IDE. They add nothing to source code, and sometimes they contain sensible information about your machine that you probably don't want to share.

This repo on github is a nice collection of gitignore templates:

https://github.com/github/gitignore

Rails template is available: https://github.com/github/gitignore/blob/master/Rails.gitignore

EDIT
If you have files with you current configuration, which are important for your app, remove all the sensitive information from them, check them in, and after that modify gitignore file.

If you have already checked in a file with passwords, use this manual: http://help.github.com/removing-sensitive-data/


Create a .gitignore file in your root directory, and add all the files which you do not want to track. Make sure those files are not already tracked. If they are, delete the files, commit the change to the git repository, and then add those files to your .gitignore file.

Your .gitignore file could look something like this


log
db/*.sqlite3
db/*.sql
*.tmproj
tmp
coverage
config/database.yml
*~
\#*\#
.\#*
target/*
**/.DS_Store
.DS_Store

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜