Skip to content

Instantly share code, notes, and snippets.

@phlco
Last active August 29, 2015 13:57
Show Gist options
  • Save phlco/9876980 to your computer and use it in GitHub Desktop.
Save phlco/9876980 to your computer and use it in GitHub Desktop.
moving rails app into main repo folder

Moving your project up

When you work on a Rails project you want your .git repo to be in the root of your Rails App.

This is very important for hosting your app on Heroku.

Many of you have the following repo structure:

# A project folder, with a rails app inside of it.
|-your_project_folder
  |--.git
  |--README.md
  |--ERD.png
  |--rails_project_app # this should be the root of the repo
    |--app
      |--assets
      |--controllers

What you want is the following

# A rails app
|-your_project_folder
  |--.git
  |--README.md
  |--ERD.png
  |--app
    |--assets
    |--controllers
    |--etc...

In order to fix this, navigate to the root your Project folder and copy your Rails App into to the root.

$ cp -rf rails_project_app/* ../your_project_folder/

Once you've confirmed this is successful you can delete your old Rails ap

$ rm -rf rails_project_app
@crywolfe
Copy link

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment