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

Cloning repo redirects to another one

Daniel G May 23, 2018

Hi Atlassian community,

 

I'm working with one github repo currently, and I need to add another that I will be working with, but  when I want to clone a new repo from remote (github), it's telling me:

"warning: redirecting to <current repo>"

So it just downloads the old repo instead...

I reinstalled git and sourcetree on my machine (windows), but problem persists.

I tried cloning from commandline, but I get the same result.

Havn't found anything on google about such an issue, so I'm quite clueless of where to even look. I'd be very grateful for any help.

2 answers

1 vote
Daniel G May 24, 2018

I have found the solution to my problem, apparently Git somehow created a config file in C:\AppData\Git which had the url to my previous repository, I'm still not sure how this file was created but seems that sourcetree used it by default instead of its own config. So I just removed that config file and cloned another repository without problem.

0 votes
Yogesh Mude
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.
May 23, 2018

Hi @Daniel G,

Why can't you create one new empty repo and then try to clone and see if still, this error persist?

Daniel G May 23, 2018

Hi @Yogesh Mude,

Thank you for replying, it's not something in git, it is something in my local machine because a co-employee can clone another repo without problem. The question is why it writes me that it redirects to another repo, is there some config file that can state such a thing in sourcetree or git?

Yogesh Mude
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.
May 23, 2018

Hi @Daniel G,

Ok, see the first time when you clone the repo to your working dir/local machine then it will create .git file or we can say it will initialize with that repo.

Try to create a new directory into the local machine then cole the repo and see.

Daniel G May 23, 2018

I create a new directory for the new repo, it just redirects to the old repo and downloads the contents of that repo to this directory. Any ideas?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events