Using Git to track Ruby on rails

Other than the database and log files are there any other files that should not be in the repository for security reasons?

The project will mostly be worked on by myself however the code is to be stored on a shared repository which will be available to a few other users should they want to pull from it. The project is reasonably simple, so i am not too worried about security in my actual code – this is more to protect any test data etc and to build up ‘good practice’ in this type of project.

  • Is there a difference between GIT's use of the term “checkout” and SmartGit's use of it?
  • Git Reset - remotes/origin/master not in sync with local master
  • MSBuild — Use the .csproj file or roll your own?
  • Does Perforce support distributed version control systems?
  • How to tag an older commit in Git?
  • How to use git rebase properly?
  • Can I amend a commit to the master branch from a new local branch?
  • How do you deal with new dependencies on an older pull request in Github?
  • One Solution collect form web for “Using Git to track Ruby on rails”

    A typical .gitignore file in a “ruby on rails” context could look something like:


    But, as pointed out by the article “rorgitignore : .gitignore files specific for Ruby on Rails”, you can also use .gitignore to add empty directories.

    Because git tracks contents, not files, it doesn’t save any empty
    directories, since there is no content to track.

    This means that when you clone your project from a git repository, it is
    missing the log, tmp, lib and other directories.

    This small script fixes that, so git adds even empty directories

    for DIR in `find . -type d | sed -re 's/\.\///g' | grep -v '^\.git'`; do
        [ `ls -a $DIR | wc -l` -le 2 ] && \
        echo Creating and git-adding $DIR/.gitignore && \
        touch $DIR/.gitignore && \
        git add -f $DIR/.gitignore

    this just outputs the commands to add an empty .gitignore file to all empty directories in a git project and git add -f’em to the repo.

    If you are still focused only on the main .gitignore file, here is a more complete one, from iCoreTech Research Labs

    Git Baby is a git and github fan, let's start git clone.