none
push Git repo to multiple remotes using Visual Studio 2013 preview

    Question

  • Hello,

    I have a local git repository and have configured two remotes, one for visualstudio.com and one for github.com. I believe the situation is similar to the one described in this question:

    Combine Host TFS with in-house Git repo?

    However, when I push changes using Visual Studio preview 2013, the changes are only pushed to the visualstudio.com repository. The github.com repository is unaffected.

    If I use a git command line to push the changes, both remotes are properly affected ("git push origin master").

    I was wondering if there was something particular about the command used by Visual Studio when performing a push action that is different from what is done with a command line operation, and if there is someway to modify it to properly push to all configured remotes?

    Thank you.

    Thursday, August 29, 2013 2:45 AM

Answers

  • Hi michaelkdaw,

    Thanks for your post.

    We can map local git repository to remote git repo on TF Service or GitHub via VS. Only one remote git repo can be mapped with local git repo in the while. So if we push changes to remote git repo by VS, only one remote git repo is affected. I'd like to know what's the actual git command do you use to push changes to the both remote git repos. 

     

    Best regards,


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 30, 2013 8:32 AM

All replies

  • Hi michaelkdaw,

    Thanks for your post.

    We can map local git repository to remote git repo on TF Service or GitHub via VS. Only one remote git repo can be mapped with local git repo in the while. So if we push changes to remote git repo by VS, only one remote git repo is affected. I'd like to know what's the actual git command do you use to push changes to the both remote git repos. 

     

    Best regards,


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 30, 2013 8:32 AM
  • Hi Kimi,

    Apologies for net getting back sooner. I had mistakenly not set an email alert for the thread and didn't realize there had been a response.

    I use the following command to update both remote repositories:

    git push origin master

    The git config file is where I have configured the two remotes to be affected by a push to "origin":

    [remote "tfs"]
    	url = https://[myTfsProjectUrl]
    	fetch = +refs/heads/*:refs/remotes/tfs/*
    [remote "github"]
    	url = https://github.com/[myGitHubUrl]
    	fetch = +refs/heads/*:refs/remotes/github/*
    [remote "origin"]
    	url = https://[myTfsProjectUrl]
    	url = https://github.com/[myGitHubUrl]
    	fetch = +refs/heads/*:refs/remotes/*
    [branch "master"]
    	remote = origin
    	merge = refs/heads/master

    With this configuration, if I use the command I mentioned above in the command line (I'm using the github powershell app) then both repositories are updated.

    I hope this helps.

    Michael Daw

    Thursday, September 05, 2013 1:17 AM
  • Hi Michael,

    Thanks for your reply.

    As I mentioned above only one remote git repo can be mapped with a local git repo at the same time. If you have any other questions and concerns, please open a new thread.

    Best regards,


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, September 05, 2013 9:18 AM
  • Understood. Thanks for getting back to me.

    For now, the command line push command is working fine for updating two remotes.

    Thursday, September 05, 2013 8:00 PM