Documente Academic
Documente Profesional
Documente Cultură
Following instructions I found in the internet I was able to initialize my Git repository and configure it to point to the TFS
server with the following commands (from a DOS Command window):
cd [folder with git repository]
Change directory into the git repository folder
git init
Im not 100% sure why I had to do the above step but after many unsuccessful attempts to configure git issuing the init
command made the configure step work
git tf configure [http://sttfs3:8080/tfs/ProjectsCollection] [$/Users/User/repository/project] --deep
Where in the command above the first section inside brackets is the URL for the TFS projects collection and the second
section inside brackets is the local folder with the git project to be imported into TFS. Im not sure what the configure
command does but it appears to me that it creates the bridge between the local git repository and the remote TFS
repository. There were a lot of errors generated during my attempts to save the project to TFS (see the section Errors I
received below) but at the end modifying the config file that is located inside of the .git folder (that in turn is located
inside the projects folder) made it all possible. The section I had to change was the [git-tf server] section. This is was
it ended up looking like:
[git-tf "server"]
collection = http://sttfs3:8080/tfs
serverpath = $/ProjectsCollection/project
Where the right side of the collection variable is the TFS url and the right side of the serverpath variable is the name of
the collection followed by the name of the project.
After modifying and saving the config file the last command issued was the following:
git tf --no-lock checkin
That produced the following message:
Connecting to TFS...
Checking in to $/ ProjectsCollection / project: 100%, done.
Checked in 203 changesets, HEAD is changeset 234
Then connecting to the TFS server showed me a new folder with the contents of my original SVN repository history and
all. Heres a screenshot:
Errors I received:
git-tf: not a git repository (or any of the parent directories): .git
git-tf: A server path must be absolute: $Users/user/directory/project
git-tf: Could not find a valid TFS Collection at http://sttfs3:8080/tfs/ProjectsCollection
git-tf: Could not lock $/Users/user/directory/project
git-tf: specified tfs path '$c:/Users/user/directory/project' is not a valid server path
[git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.TF10175: The
team project folder $/Users does not exist. Contact your Team Foundation Server administrator and ask that it be
created.
TF10175: The team project folder $/Users does not exist. Contact your Team Foundation Server administrator and ask
that it be created.]warning: push.default is unset; its implicit value is changing in [Git 2.0 from 'matching' to 'simple'. To
squelch this messageand maintain the current behavior after the default changes, use: git config --global push.default
matchingTo squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git
help config' and search for 'push.default' for further information.(the 'simple' mode was introduced in Git 1.7.11. Use
the similar mode'current' instead of 'simple' if you sometimes use older versions of Git)
fatal: 'c:/Users/user/directory/project does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.]
Git-tf websites:
http://gittf.codeplex.com/
https://github.com/git-tfs/git-tfs/tree/master/doc/commands