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

  • Home
  • SEARCH
  • 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 6929693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:21:01+00:00 2026-05-27T11:21:01+00:00

How do you change the git repository a rail app is pushed to? I

  • 0

How do you change the git repository a rail app is pushed to? I know that this is possible because I did it a few weeks back.

Basically I have two very different versions of a app on my local machine. I would like the initial app to still point to the old repository. However, the new version needs to be placed in a completely separate repository.

When I run git init in myapps/old_app/ it puts Reinitialized existing Git repository in /Users/jamespollard/rails/old_repository/.git/

AND

When I run git init in myapps/new_app/ it puts Reinitialized existing Git repository in /Users/jamespollard/rails/new_repository/.git/

However, when I try and git push anything to the repository, it still goes to the old_repository.

Updates

If I enter $ git remote origin set-url git@github.com:mygithub/myapp.git
I get

error: Unknown subcommand: origin
usage: git remote [-v | --verbose]
    or: git remote add [-t <branch>] [-m <master>] [-f] [--mirror=<fetch|push>] <name> <url>
    or: git remote rename <old> <new>
    or: git remote rm <name>
    or: git remote set-head <name> (-a | -d | <branch>)
    or: git remote [-v | --verbose] show [-n] <name>
    or: git remote prune [-n | --dry-run] <name>
    or: git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
    or: git remote set-branches <name> [--add] <branch>...
    or: git remote set-url <name> <newurl> [<oldurl>]
    or: git remote set-url --add <name> <newurl>
    or: git remote set-url --delete <name> <url>
    -v, --verbose         be verbose; must be placed before a subcommand

If I enter $ git remote set-url git@github.com:mygithub/myapp.git I get the same error message as above (minus the origin error). In either case, if I run git push origin master it still pushes to the old repository. I’ve tried adding the new repository again with the same name, but I get a error (which i would expect) saying that it already exists.

  • 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-27T11:21:02+00:00Added an answer on May 27, 2026 at 11:21 am

    Create a new repository in GitHub for you new app, if you haven’t already. Make that new repository as origin to your new repository:

    git remote add origin <github_url>
    

    If the remote already exists, you might have to git remote set-url origin <github_url>

    Now, push to the repo.

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

Sidebar

Related Questions

Say I'm in a Git repository. I delete a file and commit that change.
I have a library Google that I keep in a separate GIT repository. This
Let's pretend I have a project directory that isn't a git repository. This project
I'm working with a git repository that's storing data for a website. It contains
I set up a rails app on a laptop, and started local git repository
Short version: Is there a way to check-in a change to a git repository
I would like to have a git repository that consists mainly of binary files.
How can i change the origin url in the GIT Repository. I dont want
I have a simple erb template that pulls information from a (Grit) git repository.
I have a file in my GIT repository that I changed through the github.com

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.