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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:14:01+00:00 2026-06-13T11:14:01+00:00

I want to do a git push , and the changes should be push

  • 0

I want to do a git push, and the changes should be push to two different origin. Is there a way to push to more than one origin with one command with git? A nice hook maybe?

  • 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-13T11:14:02+00:00Added an answer on June 13, 2026 at 11:14 am

    I’ve used two methods to do this. One method, that I find convenient when I have a forked repository, and an upstream remote, is to use the pushurl config option on the remote. For just the origin, it would look something like this:

    [remote "origin"]
        url = git@github.com:user/repo.git
        pushurl = git@github.com:user/repo.git
        pushurl = git@github.com:me/repo.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    

    In the case of a forked repository, I use the pushurl trick in the upstream remote, and have it push to both my fork and the upstream repo. It helps to keep the master branches in sync with little fuss.

    I’ve also used a post-receive hook on repositories I have hosted on my infrastructure to mirror them elsewhere (like GitHub). The post-receive hook looks like this:

    nohup git push --mirror git@github.com:user/repo.git &> ~/.mirror.log
    

    Then I push to my repo on my server, then the server pushes to the GitHub clone. You need to make sure you have the SSH keys set up properly, but other than that, it’s pretty easy.

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

Sidebar

Related Questions

Generally whenever i want to push in the changes to remote Git i follow
I'm using Git 1.7.4.1. I want to push commits I did on one folder
Possible Duplicate: How git works when two peers push changes to same remote simultaneously
I want to access a repository using both GIT and SVN clients. A way
I want to be able to pass anything to a git command (maybe its
Is there a way to tell git to ignore a file that's stored in
I had a mistake and commit some changes to git which I should not
I have a repo in which I want to push changes. I want to
i'm trying to push local changes: git push all all means repo on github
I want to tell git to ignore e.g. jpg files regardless of how the

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.