Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repository commingling with two remote repos on different hosts

Charlotte Manning June 11, 2014

I recently created a new repository on bitbucket with conventional naming scheme of 'origin' and added it to Sourcetree in the Bookmarks window. Now an existing repository (also named origin) that I have been editing with sourcetree (hosted on github) appears to think it is pointing to this new repo. If I view the Hosted Repositories window, these two repositories show the correct hosts. I can't figure out how to view the remote url setting (which I suspect may be the issue) within Sourcetree. I believe I have mixed hosts (beanstalk) in the past without issue.

5 answers

1 accepted

0 votes
Answer accepted
Charlotte Manning June 16, 2014

.git/config file from existing repository was somehow modified during setup of 2nd repository on different host. See above steps to repair.

0 votes
Charlotte Manning June 11, 2014

thanks!

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2014

Now that you've fixed the old repo's config file, run a "fetch" command to fix your issue with git status.

0 votes
Charlotte Manning June 11, 2014

1) Git & OSX 10.8.5 & Sourcetree 1.9.4

2) Yes, that's correct - I can verify that the .git/config file in my older GitHub local repo was modified to point to the new Bitbucket repo. Only thing I remember doing on the commandline was 'git init' inside the new repo when I created it. I have edited the older repo's config file to restore the correct remote url, but git status still reflects the other remote (tells me I have lots of pushes) - which is purely my issue in not fully understanding git, and I'll try to hunt down the cause before being tempted to give up and just re-clone.

3) Yes, they have distinct bookmarks & hard drive locations (Hosted Repositories view even shows the distinct hosts).

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2014

Ok, a few questions and clarifications:

1) Git or Hg (Mercurial)? Windows or Mac?

2) Please remember that SourceTree is working with local repositories, and each repository should have an independent set of remotes. You say "an existing repository (also named origin) that I have been editing with sourcetree (hosted on github) appears to think it is pointing to this new repo". That makes it sound like Github has your new Bitbucket repo as a remote. I think you mean to say that your local clone of your GitHub repository now has the Bitbucket repo as its origin remote. Is this correct?

3) Please verify that the two local repositories are completely separate - they should be different SourceTree bookmarks AND reside in different locations on your hard drive.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events