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 8502103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:23:32+00:00 2026-06-11T01:23:32+00:00

I have two origins in my git repo: Origin: this is the GitHub origin.

  • 0

I have two origins in my git repo:

  • Origin: this is the GitHub origin.
  • Heroku: the Heroku origin.

How can I push to the master branch of both origins with a single git push? I’m currently doing git push origin master && git push heroku master, but I feel there’s a easier way. Thanks!

  • 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-06-11T01:23:33+00:00Added an answer on June 11, 2026 at 1:23 am

    In your <repo>/.git/config you can do something like this (I’m assuming the github and heroku remotes are already defined, but you may have different actual names for them):

    ... other stuff ...
    [remote "github"]
        fetch = <refspec>
        url = <github_url>
    [remote "heroku"]
        fetch = <refspec>
        url = <heroku_url>
    [remote "both"]
        url = <github_url>
        url = <heroku_url>
    

    Then, when you run git push both, it will push to both. You can add fetch/push refspecs or other options to the “all” remote definition too, if appropriate/necessary. I don’t think you can have different refspecs for the two urls, though so that could be a minor inconvenience…

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

Sidebar

Related Questions

I have a remote repository http://github.com/fernandezpablo85/Test This repo has a master branch, but it's
I am maintaining a fork of a git repo on github. I have two
Can a project have two (or more) origins in Git? I would like to
I am a relative beginner at git - I have two branches: master and
if I have two git projects on my machine with two different ProjectNames can
I have two jobs on my Jenkins server. Both are based on git but
I have two branches: master and dev I want to create a "feature branch"
Related question: why does Git send whole repository each time push origin master The
I have this situation: I have two repositories on my machine, both are based
In my application i have two drop down boxes first box had origin second

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.