Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5943815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:26:59+00:00 2026-05-22T16:26:59+00:00

on a remote server i have a rails 3 app. i understand that i

  • 0

on a remote server i have a rails 3 app. i understand that i cannot push changes to a non bare repository. so,

  1. on the production machine, in the rails root directory, i created a directory named ‘.git’
  2. cd into the new .git directory
  3. ran git init –bare
  4. then from my development machine entered this command: git push ssh://jay@domain.com:12345/home/jay/public_html/domain/.git master:master

The push seemed successful because i got this msg:

Counting objects: 235, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (214/214), done. 
Writing objects: 100% (235/235), 399.79 KiB, done. 
Total 235 (delta 44), reused 0 (delta 0) 
To ssh://jay@domain.com:12345/home/jay/public_html/domain/.git 
* [new branch]      master -> master

changes were made in the bare ‘.git’ directory but no changes were made to the remote production machine code. Is there another command that i need to run after pushing the changes?

UPDATE: I am the only developer. There are only two repositories.
1. on my development machine i installed git and then ran init, add and commit
2. on my remote production server i installed git and performed the the steps above

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:27:00+00:00Added an answer on May 22, 2026 at 4:27 pm

    I think you are looking for something like having git-hook – post-receive hook to be specific – in your bare repo that will push to other repo which is the “remote production machine code”

    First of all, dont create a .git directory. Just do a git init --bare in the directory where you want the git repo. This need not be in public_html. Now in your public_html\domain clone the other bare repo. Now you have your production code. Setup a post-receive hook in the bare repo’s hooks folder and have that push to the other repo in public_html. ( you may need to add a remote to the other repo ). This way, when you push from your development machine, the production code gets updated as well.

    cd /home/repos/repo
    git init --bare
    cd /home/jay/public_html/domain
    git clone ../../../repos/repo .
    cd /home/repos/repo/hooks
    vi post-receive
    ( add post-receive hook content, make it executable)
    

    You can add a remote to the code repo with git remote add prod /home/jay/public_html/domain . With that setup, you can have your post-receive hook do git push prod master

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a remote server that hosts my subversion repository on a non-standard ssh
I have 2 servers. The hosted rails app server and git repository server. The
I have a remote server that has win2003 installed I can connect to the
I have a folder on my remote server that has a few .png files
I have a script that retrieves objects from a remote server through an Ajax
I have some code that downloads an image from a remote server $data =
I have a SWF file that connects to a remote flash server and receives
I have a number of Rails 3.1 applications running on a local server, remote
I have a Rails 3 app and just noticed that when using Chrome (on
I have a Rails 3.0 app which is using a normal :remote => true

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.