Adding an upstream repo

18 views
Skip to first unread message

John Emmas

unread,
Apr 2, 2020, 6:29:20 AM4/2/20
to tortoisegit-users
I've done this in the past a few times but it was a long time ago and I
don't seem to be doing it right any more... :-(

I entered my 'Settings' dialog and under 'Git->Remote' I've created an
upstream repo called 'upstream' and entered its URL. So I now have 2 x
remotes called 'origin' and 'upstream'.

BUT... if I then open my Reference Browser and click 'remotes' it only
lists 'origin'. There's no entry for 'upstream' so obviously I can't
pull or fetch etc. I'm guessing I need to sync something somehow but I
can't remember how... I've also checked a few web sites but I still
couldn't find out how to do it... :-(

Can some kind soul remind me how to make the upstream repo usable..?

John

michae...@gmail.com

unread,
Apr 2, 2020, 6:01:56 PM4/2/20
to tortoisegit-users


On Thursday, April 2, 2020 at 6:29:20 AM UTC-4, John Emmas wrote:
I've done this in the past a few times but it was a long time ago and I
don't seem to be doing it right any more... :-(

I usually just use the git bash command line. 


git remote add upstream uri-or-path-to-repo

Works for both proper Git Uri's as well as local or network file system. I do that all the time, including to reconnect broken or newly minted origin based repos.

git remote -v to verify.

HTH

jo...@creativepost.co.uk

unread,
Apr 3, 2020, 6:30:22 AM4/3/20
to tortoisegit-users
Many thanks Michael - after trying the git bash stuff, git remote -v now shows me:-


However... the basic problem is still there! 'Settings->Git->Remote' shows me both remotes (origin and upstream) but the Reference Browser only shows origin. And if I try to Switch/Checkout it only offers branches from origin... weird?!?

jo...@creativepost.co.uk

unread,
Apr 4, 2020, 7:03:05 AM4/4/20
to tortoisegit-users
This turned into a horrible faff... I tried ditching the project and starting again but that didn't work either. So in the end I needed to choose a project that was similar to the new one but which already had a working 'upstream' repo. I renamed the project and deleted the branch that I'd eventually want to keep (i.e. master).

Next I re-entered the URL's (for origin and upstream) so that they'd each point to the correct repo's and I then re-booted. I could now pull master (from both the 'original' repo and also from 'upstream'). Finally I switched to 'master' and deleted any unwanted branches from the older project. The weird thing is that I've used this feature in the past and never had any problems with it... :-(
Reply all
Reply to author
Forward
0 new messages