Connecting to an existing Git repo

Nov 22, 2012 at 5:58 PM

(I posted this first to the "configure" page, then realised it might be more appropriate here ...)

Hi there,

I've got an existing repo which I'm trying to connect to a local TFS. I can call "connect" ok when in the repo (I've tried calling it from another directory, and it fails), but when I try to push or pull, nothing happens, eg:


>git tf configure http://yeps84332:8080/tfs/Demo $/Win8Proto/Main
Configuring repository

then

>git tf pull
git-tf: this git repository is not configured to use git-tf

is there anything I can do to trace the problem? I've been successful in creating brand new TFS projects and git repos and moving code around, but using "connect" for an existing git repo, no luck so far

good work so far chaps

Toby

Developer
Nov 26, 2012 at 3:00 PM

Hello Toby,

I think what you need to do is clone instead of configure and pull. You need to execute:

git tf clone http://yeps84332:8080/tfs/Demo $/Win8Proto/Main

[Which will automatically create a repository, configure and pull changes from tfs]

The reason configure exists is if the user wants to push an existing repository into tfs. In this case the user should execute git tf configure then git tf checkin.

Thanks,

Youhana

Nov 27, 2012 at 2:28 PM

Hi Youhana,

 

thanks, but I am the user who wants to push an existing repository into tfs ...  - as I say above, when I execute " git tf configure" then it returns "Configuring repository", but when I then call anything else (eg "git tf checkin"), it responds with "git-tf: this git repository is not configured to use git-tf"

 

I've no problem using git-tf when cloning from an existing TFS, unfortunately I'm in the position where I'm starting with an existing Git repo and trying to link that into TFS ... doesn't seem as keen

 

T

Developer
Nov 27, 2012 at 2:48 PM

Hello,

Can you please run :

git tf configure http://yeps84332:8080/tfs/Demo $/Win8Proto/Main

in your repository and let me know what the contents of your .git\config file are ? You should see the configuration entries there ? Is that not the case ?

Thanks,

Youhana

Nov 27, 2012 at 3:03 PM
Edited Nov 27, 2012 at 3:03 PM

Hi Youhana,

it's got a [core] entry with the details of the existing repo, but nothing with TFS references  - I should say that this is already connected to Codespaces, I was hoping to get this working as a bridge between a Codespaces remote repo and a local TFS  - is that too optimistic? The config file has the a "url" reference towards the codespaces repo

I just tried creating another local repository, clean, without any external references, and called configure - the config file now contains:

 autocrlf = false[git-tf "server"] collection = http://yeps84332:8080/tfs/Demo serverpath = $/Win8Proto/Main[git-tf]

T

Developer
Nov 27, 2012 at 3:11 PM

That should be possible, we use git-tf internally as a bridge between codeplex and a local TFS server.

If the config is not readable by git-tf still? Can you open the config file using Notepad++ and view all characters. What are the line endings like in the config file? There is probably a bug / issue with reading the config file.

Thanks,

Youhana

Nov 27, 2012 at 3:25 PM

Hi Youhana,

>There is probably a bug / issue with reading the config file.

 

so, I opened the config file with Notepad, but couldn't edit it  - I had to re-open with Administrator priviliges. And yes, running 

 

 

git tf configure http://yeps84332:8080/tfs/Demo $/Win8Proto/Main

 

 

in a command window with admin priviliges ... yep, that did the trick

 

thanks for your help in getting me here. I've a new problem now, in that the Git repo has 2 folders, identically named, but with different cases, which TFS doesn't like one bit!  

Be boring if it was easy ...

 

cheers

 

T

Developer
Nov 27, 2012 at 3:34 PM

Hello,

This should not be too hard to fix. Details on how to fix this is in this thread : http://gittf.codeplex.com/workitem/44 . Let me know if this does not work.

Thanks,
Youhana

Nov 27, 2012 at 3:39 PM

aha - so we should be OK using a Mac to call git mv?

 

cheers


T

Developer
Nov 27, 2012 at 3:44 PM

For that particular case in the thread, yes. But it depends on the case, most cases could be fixed in Windows easily. It depends on the file/folder that exist twice. If the problem is with a folder, then a git mv could be executed in windows to fix the issue. If the problem is with a file that exists twice (2 blob ids) then this would have to be fixed on a case sensitive OS.

Nov 29, 2012 at 9:34 AM

Hi Youhana,

thanks for all your help - I've a complete end-to-end Windows 8 Store automated build and unit test process now. Longer than I would like, but it definitely works

cheers

Toby