Git Product home page Git Product logo

git-tfs's Introduction

Introduction

git-tfs is a two-way bridge between TFS (Team Foundation Server) and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.

git-tfs version. See the change history for details and download.

If you're having problems, check out the troubleshooting page. And read how to report an issue, before doing so ;)

We need your help

This project is no more actively maintained because we are no more users of TFS. Thus being very useful, git-tfs is not exempt of not supported use cases. If you encounter something missing or a problem, please contribute, we will be pleased to help you.

And remember:

The fastest way to get an issue fixed is to submit a PR that fixes it.

The slowest way to get it fixed is to hope someone else will fix it.

Get git-tfs

To get a stable version:

To get a development version

  • Build from source code. See §Building for more informations...
  • Download a package of the development version generated by the last builds (in the artifacts section).

Whatever the way you get git-tfs, you should have git-tfs.exe in your path (and git, too).

Add the git-tfs folder path to your PATH. You could also set it temporary (the time of your current terminal session) using :

set PATH=%PATH%;%cd%\GitTfs\bin\Debug

Use git-tfs

You need .NET 4.6.2 and the 2012 or 2013 version of Team Explorer installed (or Visual Studio) depending on the version of TFS you want to target.

Help

#lists the available commands
git tfs help

#shows a summary of the usage of a given command
git tfs help <command>

Cloning

# [optional] find a tfs repository path to clone :
git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection

# clone the whole repository (wait for a while...) :
git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project <dist_folder_where_to_clone>

# or, if you're impatient (and want to work from the last changeset) :
git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project <dist_folder_where_to_clone>

# or, if you're impatient (and want a specific changeset) :
git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project -c=145

Note: Before cloning your repository, please have a look at the clone command doc or advanced use cases to discover options that could help you!

Working

cd some_project
git log # shows your TFS history, unless you did quick-clone
tf history # error: no workspace ;)

# [do work, do work, just using git], then...
# gets latest from TFS to the branch tfs/default :
git tfs fetch

Checkin

# report all the commits on TFS :
git tfs rcheckin

# or commit using the tfs checkin window
git tfs checkintool

# or commit with a message
git tfs checkin -m "Did stuff"

# or shelve your changes :
git tfs shelve MY_AWESOME_CHANGES

git-tfs is designed to work outside of any existing TFS workspaces.

More advanced use cases

Have a look to more detailed git-tfs use cases:

Available commands / options

This is the complete list of commands in the master branch on github.

Repository setup

  • list-remote-branches: list tfs branches that can be cloned or initialized - since 0.17
  • clone: clone a tfs path/branch and its history in a git repository - since 0.9
  • quick-clone: clone a specific changeset of a tfs path/branch in a git repository - since 0.9
  • bootstrap: bootstrap an existing git-tfs repository cloned from an existing repository - since 0.11
  • init: initialize a git-tfs repository (without getting changesets) - since 0.9

Pull from TFS

  • clone: clone a tfs path/branch and its history in a git repository - since 0.9
  • fetch: get changesets from tfs and update the tfs remote - since 0.9
  • pull: get changesets from tfs, update the tfs remote and update your work - since 0.9
  • quick-clone: clone a specific changeset (without history) of a tfs path/branch in a git repository - since 0.9
  • unshelve: fetch a tfs shelvesets in your repository - since 0.11
  • shelve-list: list tfs shelvesets - since 0.12
  • labels: fetch tfs labels - since 0.17

Push to TFS

⚠ Read absolutely this if your TFVC repository use Checkin policies when check-in.

  • rcheckin: replicate your git commits as tfs changesets - since 0.12
  • checkin: checkin your git commits as one tfs changeset - since 0.10
  • checkintool: checkin in tfs using the tfs checkin dialog - since 0.10
  • shelve: create a shelveset from git commits - since 0.9
  • shelve-delete: delete a shelveset on tfs - since 0.25

Manage TFS branches

Other

  • info: get some informations about git-tfs and tfs

  • cleanup: clean some git-tfs internal objects - since 0.10

  • cleanup-workspaces: clean tfs workspaces created by git-tfs - since 0.10

  • help: get help on git-tfs commands - since 0.9

  • verify: verify the changesets fetched - since 0.11

  • autotag option - since 0.12

  • subtree: manage sparse tfs pathes with git-tfs - since 0.19

  • reset-remote: reset a tfs remote to a previous changeset to fetch again its history - since 0.19

  • checkout: checkout a commit by a changeset id - since 0.21

  • diagnostics (for git-tfs developers only) - since 0.9

  • config file

  • For authentification with user credentials or using a PAT, clone command.

Building

Continuous Integration Status

AppVeyor build status ( Great thanks to AppVeyor! )

Prerequisites

  • MSBuild (included in .NET 4)
  • Visual Studio >= 2017 (preferably >= 2019)

Get the source code and build

#get the source code
git clone git://github.com/git-tfs/git-tfs.git
cd git-tfs\src

#building with Cake (in a powershell console). It will also run the unit tests ;)
.\build.ps1

#help on the different targets
.\build.ps1 -Target "Help"

Note: if the build fails to build some GitTfs.Vs201x projects, just unload in Visual Studio all the projects you are not interested in to be able to build and use your own version. You could also install, the Team Foundation Server Object Model for Tfs 2012 (chocolatey) and Tfs 2013 (chocolatey).

Contributing

Contributions are always welcome. Thanks to all our contributors!

Please, read our short and simple guidelines and our doc on how to use paket, the package manager we use.

Especially, don't forget:

  • to run the build task .\build.ps1 -Target "FormatCode" before committing (to keep code formatting consistent, and pull request easier to review)
  • to indent your code using 4 spaces (even if .editorconfig should take care of that).

Migrations

If you're migrating a TFS server from 2008 or 2005 to 2010, you might want to Specify Alternate TFS URLs.

If you have questions or suggestions about how we could improve git-tfs you could go to google group.

Example of setting up central git repository that tracks TFS automatically.

Community

Drop in and chat in gitter We also have a mailing list.

git-tfs's People

Contributors

allansson avatar boogisha avatar caseykramer avatar chijos avatar ckorn avatar davidalpert avatar dougwebb avatar fineol avatar fourpastmidnight avatar gburgett avatar gentoo90 avatar hazzik avatar ivan-danilov avatar jacob1123 avatar jamesdunne avatar jru avatar ketiko avatar kgybels avatar kinddragon avatar laibalion avatar nathanlbcooper avatar nils-a avatar oklemencic avatar patthoyts avatar pmiossec avatar rcuhljr avatar roend83 avatar sc68cal avatar siprbaum avatar spraints avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-tfs's Issues

Specify authentication

The TFS command line tf.exe allows you to pass a username/password. I work on a laptop that is not part of the domain (which is why I'd want to work offline with Git), so I need to pass authentication to git-tfs.

checkintool on x64 machine

The GetVs2010InstallDir method in TfsHelper.Vs2010.cs only works on 32-bit machines, as the registry location is different under x64. For x64 machines it should be: HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0

The current work-around I'm using is to manually copy the InstallDir registry key from the 32-bit node into the 64-bit key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0]
"InstallDir"="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"

Obviously, this is not ideal. It would be nice if the GetVs2010InstallDir method could detect if you're running on an x64 machine and use the appropriate location.

Getting error: The System cannot find the specified file.

Using

git-tfs.exe quick-clone http://mytfslocation:8080 $/mytfsdir MyNewGitRepo

This threw an error: "The system cannot find the specified file".
I thought this was due to an inability to connect to tfs or to the specified dir in TFS.
This was not the case. The issue was due to the git executable not being found on the system PATH. Adding git.exe ahead of git.cmd on the PATH env variable worked.

Note the error was thrown from GitHelpers.cs
protected virtual Process Start(string [] command, Action initialize)
..
var process = Process.Start(startInfo);

The startInfo contains the "startInfo.FileName = "git";"
The command git is not found.

Hope the above saves someone time :)

git (msysgit) does not find git-tfs

The install instructions seem very basic, unfortunately I could not get it to work. When I run 'git tfs' from within git, it complains the command does not exist. I am running WindowsXP with latest service packs. Visual Studio 2008 is installed on my machine.

I did the following:

  1. Installed msysgit (msysgit is not in my PATH)
  2. Download git-tfs-0.9.zip
  3. Unpacked the zip, added the target to my PATH.
  4. Verified that "git-tfs" command is recognized from my command shell in other paths
  5. Opened msysgit by running 'C:\msysgit\msysgit\msys.bat'.
  6. Type git tfs

the git shell outputs:

$ git tfs
git: 'tfs' is not a git command. See 'git --help'.

Did you mean one of these?
        notes
        stash
        tag

Merge-optional feature request

Currently when git-tfs performs a TFS checkin, it automatically updates refs/remotes/tfs/default to be a merge commit between the previous refs/remotes/tfs/default and the current HEAD. This makes some sense, but has an unintended side-effect of producing a completely different commit number than running "git-tfs fetch" would after someone checks something in.

# First machine:
# tfs/default -> abcde123 -> C1
$ git tfs checkin
TFS Changeset #2 was created. Marking it as a merge commit...
C2 = def456ab
# tfs/default -> def456ab -> C2
# Second machine:
# tfs/default -> abcde123 -> C1
# First machine performs checkin here
$ git tfs fetch
C2 = 789bace4
# tfs/default -> 789bace4 -> C2

If the two machines try to sync their tfs/default (to reduce redundant conversion of changesets from TFS to Git), they get a rejection because it's a non-fast-forward. The difficult/painful part is that you can't directly/easily modify refs/remotes/tfs/default without using the git base command git-update-ref.

I would propose an option to the CheckinBase called "--no-merge" which records the commit to refs/remotes/tfs/default as if it were not a merge, so that it looks the same as performing a "git tfs fetch"

Thanks for listening!

Out of memory exception when importing large history

I'm trying to import my tfs server, to do a 1 time convert over to git for good.
We have 6800 commits from 10 different people involved, towards the end of the commits, I'm getting an out of memory exception during HashAndInsertObject().

System.OutOfMemoryException

We are currently trying to export a TFS database to git, but we are encountering a System.OutOfMemoryException error when the process hits a very large file on the TFS server (500 Mb). Note that the system itself does not run out of memory during the conversion process. Is there any way we can go around this problem?

Here is the output from git-tfs :


$ ../git-tfs fetch
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at GitSharp.Core.ObjectWriter.WriteObject(ObjectType type, Int64 len, Stream
input, Boolean store) in d:\dev\buildAgent\work\5e044ae681b5c534\GitSharp.Core\ObjectWriter.cs:line 251
   at GitSharp.Core.ObjectWriter.WriteBlob(FileInfo fileInfo) in d:\dev\buildAgent\work\5e044ae681b5c534\GitSharp.Core\ObjectWriter.cs:line 97
   at Sep.Git.Tfs.Core.GitRepository.HashAndInsertObject(String filename) in D:\Projects\my\git-tfs\GitTfs\Core\GitRepository.cs:line 306
   at Sep.Git.Tfs.Core.GitIndexInfo.Update(String mode, String path, String localFile) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 49
   at Sep.Git.Tfs.Core.TfsChangeset.Update(IChange change, String pathInGitRepo, GitIndexInfo index, IDictionary`2 initialTree) in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 95
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(IChange change, GitIndexInfo index, IDictionary`2 initialTree) in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 52
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index)
 in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 28
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.b__6(GitIndexInfoindex) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 218
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line
21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.b__0(TextWriter stdin) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.b__a() in
 D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 158
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 180
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 154
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.b__5() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 218
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1c.b__1b() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 311
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 321
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 308
   at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 217
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 121
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in D:\Projects\my\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\Commands\Fetch.cs:line 50
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 47
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 30
   at Sep.Git.Tfs.Program.Main(String[] args) in D:\Projects\my\git-tfs\GitTfs\Program.cs:line 22

Auto-generate commit message for checkintool

Not sure how feasible this would be, but it would be useful if there was a way to pre-populate the checkintool with the commit messages from previous git commits on the current branch (since the last TFS checkin).

Code Analysis Policies

When using git-tfs checkin or git-tfs checkintool against a TFS server that has code analysis enforced through a check-in policy, I receive the following error:

"Evaluation of Code Analysis Policy requires Visual Studio 2010 Premium or Visual Studio 2010 Ultimate to be installed".

However, VS2010 Ultimate is installed, so I'm not sure why this would be happening.

TF10123: - Remove the '"' and try again.

Hi

I have had some problem with this error:

TF10123: The path '$/proj/"Version2.0/solution/project/Help/htmlanv/images/fram\206t.swf"' contains the character '"'. Remove the '"' and try again.

Is there some way to remove the '"' characters or even better make them legal?

Tanks,
Christian

Cannot use checkintool

I added some files to my local repo and committed them. When I try to use "git tfs checkintool" though, I get the error...

"The item C:....git\tfs\default\workspace...\file.ext could not be found in your workspace, or you do not have permission to access it"

This is preventing the checkintool from even appearing.

ArgumentOutOfRangeException: 0 is not a valid changeset number.

Windows 7 Ultimate x64
TFS 2008 on a remote server (over an internet connection)

I ran the command

Z:\sampleproj> git tfs quick-clone http://server-name:8080 $/main .

And received the error

Initialized empty Git repository in Z:/sampleproj/.git/
System.ArgumentOutOfRangeException: 0 is not a valid changeset number.  Please specify a number between 1 and 2147483647.
Parameter name: changesetId
   at Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetChangeset(Int32 changesetId, Boolean includeChanges, Boolean includeDownloadInfo, Boolean includeSourceRenames)
   at Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetChangeset(Int32 changesetId)
   at Sep.Git.Tfs.Vs2010.TfsHelper.GetChangeset(Int32 changesetId)
   at Sep.Git.Tfs.Core.TfsChangeset.CopyTree(GitIndexInfo index) in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 118
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClassd.<CopyTree>b__b(GitIndexInfo index) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 229
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 158
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 180
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 154
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClassd.<CopyTree>b__a() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 229
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1c.<WithTemporaryIndex>b__1b() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 311
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 321
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 308
   at Sep.Git.Tfs.Core.GitTfsRemote.CopyTree(String lastCommit, ITfsChangeset changeset) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 228
   at Sep.Git.Tfs.Core.GitTfsRemote.QuickFetch() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 131
   at Sep.Git.Tfs.Commands.QuickFetch.DoFetch(IGitTfsRemote remote) in D:\Projects\my\git-tfs\GitTfs\Commands\QuickFetch.cs:line 13
   at Sep.Git.Tfs.Commands.Fetch.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\Commands\Fetch.cs:line 50
   at Sep.Git.Tfs.Commands.Clone.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\Commands\Clone.cs:line 35
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 47
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 30
   at Sep.Git.Tfs.Program.Main(String[] args) in D:\Projects\my\git-tfs\GitTfs\Program.cs:line 22

GitVersionInfo file missing from repository?

Trying to build from source, it fails with the following error:

Error 1 Error reading resource file 'C:\code\git-tfs\GitTfs\GitVersionInfo' -- 'The system cannot find the file specified. ' GitTfs

(from VS2010 or msbuild, either way)

Not a big deal, I just downloaded binaries, but I thought I'd report it. Am I missing something, or is it just an oversight?

Thanks,

Peter

Cannot build the solution with only Vs2010 installed.

When I run msbuild from the command line, without any switches, it tries to build the Vs2008 projects. On a machine with only Vs2010, there's no way for that build to succeed. The built-in configurations (Debug and Release) specify all projects to build. I see two options...

  1. Maintain separate Vs2008 and Vs2010 solutions
    Least friction path... requires a new solution. You can re-use the general projects.
  2. Create custom build configurations for Vs2010 (or Vs2008)
    Most friction path. Requires the most Vs voodoo. New build configurations (Build | Configuration Manager | Active solution configurations | <New...>), at least, Debug2010 and Release2010. And a new command line param msbuild /property:configuration=Release2010.

Many IO exceptions on cloning

While cloning TFS repository with -d option git-tfs outputs literally dozens of thousands of such exceptions:

Unable to delete temp file: System.IO.IOException: The process cannot access the file 'C:\Users\idanilov\AppData\Local\Temp\2\tmp9DD1.tmp' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Delete(String path)
at Sep.Git.Tfs.Util.TemporaryFile.Dispose() in D:\work\git-tfs\GitTfs\Util\TemporaryFile.cs:line 25
U 299233b0b74ced832e4f15873d0d789d0ac44e6d = <local_repository_path>
Unable to delete temp file: System.IO.IOException: The process cannot access the file 'C:\Users\idanilov\AppData\Local\Temp\2\tmpA1E8.tmp' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Delete(String path)
at Sep.Git.Tfs.Util.TemporaryFile.Dispose() in D:\work\git-tfs\GitTfs\Util\TemporaryFile.cs:line 25
U 5c0d73cece8b9a4c5bb67d404cbef3962386387a = <local_repository_path>

Path 'D:\work\git-tfs...' is where I built GitTfs from sources.

Those exceptions doesn't seem normal...

No support for C and R change status

Just encounterd and issue where diff-tree was giving back C and R status codes for changes. I think git applied this unders the covers and i just did a git add on a copy of a file. Not a git expert yet but i can see this optimization. Anyway no way to check-in as the tool does not support this. I will look at adding the support but as i said i am in no way a git expert.

Where did the --username option for clone go?

First of all: Thank you very much for this great project! :-)

I am trying to clone from a TFS Repository and I have to provide username / password. As far as I understand, the --username option should enable this.
Seems to me that the last released version to support this option is 0.9.1 - from 0.9.2 this option went away.

So, is this a regression or is there an undocumented replacement for this option?

Best regards!

CommitTool fails to start when files have been moved

I used git mv to move a folder and some files, committed, tried to commit to TFS with git tfs ct and all went along fine until I got to this:

rename Pos/WinPOS7/Source/Test/POSUpgradeManifest.xml to Pos/WinPOS7/Source/Test/TestFiles/POSUpgradeManifest.xml (score: 100)
Trying to find an Instance of type Sep.Git.Tfs.Core.IGitChangedFile, git-tfs, Version=0.11.0.0, Culture=neutral, PublicKeyToken=null
Parameter name: instance

cmoultrie@ATLCMOULTRIE1 /c/Storage/TFS/SiteSolution7.5.2 (master)```

This has happened a few times with renaming and moving files. Best way I've found to work around currently is to back up the file(s) that cause the CT to fail (whatever is alphabetically next in the commit that was moved/renamed) and git rm, commit, tfs ct and after doing this for a few files, I can finish committing. Adding those original files back with git add, then committing and using tfs ct will avoid this issue, but very difficult to do. Using TFS 2010, git-tfs 0.11.0. Git v1.7.5.3 and using git-bash. Happy to provide any information needed and have pulled the repo and am trying to dig through the solution, but without context will take me a bit to get a feel for what is going on.

Possible to transfer git-tfs .git directory to another machine?

I was curious if it were possible to transfer a git-tfs .git directory to another machine? There's a .git/tfs/default/workspace/ folder that looks suspiciously linked to TFS, likely mapped in TFS to a workspace. I'm guessing it wouldn't be as simple as transferring the .git repo to another machine and expect it all to work on check-in. Is the missing step, assuming I'm correct, to simply register the workspace folder with TFS? If so, is there a requirement for the workspace name or anything along those lines?

git tfs clone/pull does not detect renames to path outside of cloned path

I ran into an issue, when using git tfs pull, where the tfs remote only contains a subpath of the TFS repository.

A past checkin to TFS moved a large directory within the target directory to an outside directory. This changeset showed up as a list of Rename changes in our TFS history. TfsHelper.GetChangesets() did not see this
changeset since all the renamed files were outside of the path being cloned/pulled. So the original files were left in the repository.

One solution would be to query all changesets in the repository, but then only keep the changes that impact a file in the subdirectory being cloned.

"git tfs help <command>" fails when using MinTTY or other non-conhost console with cygwin

It looks to be a problem internal to CSharpOptParse library. It works under regular conhost.exe console sessions but fails when I move over to using MinTTY with cygwin (my primary usage of git).

The latter part: 'tfs' is not a git command, is probably driven by the non-zero exit code of the help function.

$ git tfs help pull
Usage: git-tfs pull [options]
Function 'ext:FormatText()' has failed.
Exception has been thrown by the target of an invocation.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
git: 'tfs' is not a git command. See 'git --help'.

Did you mean this?
tfs

OutOfMemoryException in System.String.SplitInternal

I've been attempting to fetch the history of a very large repository (~150,000 checkins in TFS). Recently it has begun crashing with an OOM error, and slowing down quite a bit. I have pulled the latest version of git-tfs from github ( 4b41ebb ), successfully compiled, and received this error while running fetch in debug mode. On some computers it will continue through a few TFS checkins before failing, and on others it seems to run into the OOM exception before fetching even one full commit. The really frustrating part is that the machines on which it tends to succeed have less memory and CPU speed than the machines on which it tends to fail. What originally looked like a two or three day migration is now looking like a month or more. Any help would be appreciated! Thanks in advance.

$ /d/git-tfs/GitTfs/bin/Debug/git-tfs fetch -d
git command: Starting process: git config -l
git command time: [00:00:00.0350035] config -l
Fetching from TFS remote default
git command: Starting process: git log --no-color --pretty=medium refs/remotes/tfs/default
git command time: [00:00:37.3427339] log --no-color --pretty=medium refs/remotes/tfs/default
info: refs/remotes/tfs/default: Getting changesets from 134436 to current ...
git command: Starting process: git write-tree
git command time: [00:00:00.3580000] write-tree
git command: Starting process: git cat-file commit 9886a67d1e96f52afac5a6cdf8baff46702d3213
git command time: [00:00:34.6690000] cat-file commit 9886a67d1e96f52afac5a6cdf8baff46702d3213
git command: Starting process: git update-index -z --index-info
git command: Starting process: git ls-tree -r -z 9886a67d1e96f52afac5a6cdf8baff46702d3213
git command time: [00:00:39.1840000] ls-tree -r -z 9886a67d1e96f52afac5a6cdf8baff46702d3213
git command time: [00:00:41.2800000] update-index -z --index-info
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.String.SplitInternal(Char[] separator, Int32 count, StringSplitOptions options)
   at System.String.Split(Char[] separator)
   at Sep.Git.Tfs.Core.GitRepository.ParseEntries(IDictionary`2 entries, String treeInfo, String commit) in d:\git-tfs\GitTfs\Core\GitRepository.cs:line 284
   at Sep.Git.Tfs.Core.GitRepository.GetObjects(String commit) in d:\git-tfs\GitTfs\Core\GitRepository.cs:line 255
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index) in d:\git-tfs\GitTfs\Core\TfsChangeset.cs:line 28
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass6.<Apply>b__4(GitIndexInfo index) in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 262
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in d:\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in d:\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in d:\git-tfs\GitTfs\Core\GitHelpers.cs:line 160
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in d:\git-tfs\GitTfs\Core\GitHelpers.cs:line 182
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in d:\git-tfs\GitTfs\Core\GitHelpers.cs:line 156
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in d:\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass6.<Apply>b__3() in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 262
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1a.<WithTemporaryIndex>b__19() in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 355
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 365
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 352
   at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 261
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch(Dictionary`2 mergeInfo) in d:\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 138
   at Sep.Git.Tfs.Core.Ext.Fetch(IGitTfsRemote remote) in d:\git-tfs\GitTfs\Core\IGitTfsRemote.cs:line 38
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\git-tfs\GitTfs\Commands\Fetch.cs:line 64
   at Sep.Git.Tfs.Commands.Fetch.Run(String[] args) in d:\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run() in d:\git-tfs\GitTfs\Commands\Fetch.cs:line 49
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in d:\git-tfs\GitTfs\Util\GitTfsCommandRunner.cs:line 36
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\git-tfs\GitTfs\GitTfs.cs:line 56
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\git-tfs\GitTfs\GitTfs.cs:line 39
   at Sep.Git.Tfs.Program.Main(String[] args) in d:\git-tfs\GitTfs\Program.cs:line 23
Exception of type 'System.OutOfMemoryException' was thrown.

Unable to find item in GetPathBeforeRename

I'm trying to pull from a TFS 2010 repository. The pull works fine until it encounters the first rename. When I step through the code, I see it trying to get the path from the previous change set:

private string GetPathBeforeRename(IItem item)
{
    return item.VersionControlServer.GetItem(item.ItemId, item.ChangesetId - 1).ServerItem;
}

When it tries to get the item from the VCS here:

public IItem GetItem(int itemId, int changesetNumber)
{
    return _bridge.Wrap(_versionControlServer.GetItem(itemId, changesetNumber));
}

It returns null. It always returns null as well, no matter the changeset. For example, if I'm trying to rename in changeset 5, it will be null for 4,3,2, and 1.

The particular rename is part of a delete | rename and I did find something saying it wouldn't appear in the items without a certain parameter. Adding this option still returns a null.

Trying to find instance of Sep.Git.Tfs.Core.IGitChangedFile

I haven't updated git-tfs or git at all today, but all of the sudden when I try "git tfs checkintool" (which worked yesterday), I get the message "Trying to find an Instance of type Sep.Git.Tfs.Core.IGitChangedFile, git-tfs, Version=0.11.0.0, Culture=neutral, PublicKeyToken=null" "Parameter name: instance" and it doesn't show the checkintool.

I get the same issue using "git tfs checkin".

"git tfs fetch" seems to work.

ChangesetNotFoundException on fetching

The following stack traces are from git tfs pull and git tfs fetch. TFS is correct that changeset 75906 does not exist (75905 is the latest). I don't see how git-tfs thought that it did exist.

Once a new changeset was committed to TFS (via TFS tools), git-tfs stopped erroring.

$ git tfs pull
Microsoft.TeamFoundation.VersionControl.Client.ChangesetNotFoundException: TF14019: The changeset 75906 does not exist. ---> System.Web.Services.Protocols.SoapException: TF14019: The changeset 75906 does not exist.
   --- End of inner exception stack trace ---
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.ProcessHttpResponse(HttpWebResponse response, Stream responseStream, WebException webException, XmlReader& xmlResponseReader)
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.ExecWebServiceRequest(HttpWebRequest request, XmlWriter requestXml, String methodName, HttpWebResponse& response)
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.QueryHistory(String workspaceName, String workspaceOwner, ItemSpec itemSpec, VersionSpec versionItem, String user, VersionSpec versionFrom, VersionSpec versionTo, Int32 maxCount, Boolean includeFiles, Boolean generateDownloadUrls, Boolean slotMode)
   at Microsoft.TeamFoundation.VersionControl.Client.Client.<GetHistoryInternal>d__7.MoveNext()
   at Microsoft.TeamFoundation.VersionControl.Client.Client.<GetHistory>d__0.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 118
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 50
   at Sep.Git.Tfs.Commands.Pull.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\Commands\Pull.cs:line 32
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 47
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 30
   at Sep.Git.Tfs.Program.Main(String[] args) in d:\dev\github\git-tfs\GitTfs\Program.cs:line 22


$ git tfs fetch
Microsoft.TeamFoundation.VersionControl.Client.ChangesetNotFoundException: TF14019: The changeset 75906 does not exist. ---> System.Web.Services.Protocols.SoapException: TF14019: The changeset 75906 does not exist.
   --- End of inner exception stack trace ---
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.ProcessHttpResponse(HttpWebResponse response, Stream responseStream, WebException webException, XmlReader& xmlResponseReader)
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.ExecWebServiceRequest(HttpWebRequest request, XmlWriter requestXml, String methodName, HttpWebResponse& response)
   at Microsoft.TeamFoundation.VersionControl.Client.Repository.QueryHistory(String workspaceName, String workspaceOwner, ItemSpec itemSpec, VersionSpec versionItem, String user, VersionSpec versionFrom, VersionSpec versionTo, Int32 maxCount, Boolean includeFiles, Boolean generateDownloadUrls, Boolean slotMode)
   at Microsoft.TeamFoundation.VersionControl.Client.Client.<GetHistoryInternal>d__7.MoveNext()
   at Microsoft.TeamFoundation.VersionControl.Client.Client.<GetHistory>d__0.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 118
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 50
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 47
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 30
   at Sep.Git.Tfs.Program.Main(String[] args) in d:\dev\github\git-tfs\GitTfs\Program.cs:line 22

quick-clone on very large repository unacceptably slow (at least 15 hours to complete)

A quick-clone of a TFS repository with very many objects (>100k) takes upwards of 15 hours to complete using msysGit 1.7.4. There is hardly any CPU utilization going on and hardly any network traffic, but it did complete eventually. I had to leave my machine running most of the day and overnight for it to complete. I have a log file of 2,440 lines reporting number of objects created until it comes to a final count of 119221 objects and reports the git GUID for me.

NullReferenceException in Sep.Git.Tfs.Core.TfsChangeset.GetPathBeforeRename(Item item)

Thanks for the 'Handle null tfs identities.' fix, it was needed for an issue I hit here. (maybe the download should be updated if its a common issue for people).

Doing a pull of our repository, I'm hitting another issue. I'll try to look into it, but I thought I'd send a heads up. This was hit on a fork of git-tfs I have, which as far has I can tell has your latest updates to the default branch there.
In this fork, "TfsChangeset.cs:line 86" is expression:
return item.VersionControlServer.GetItem(item.ItemId, item.ChangesetId - 1).ServerItem;

Callstack:
System.NullReferenceException: Object reference not set to an instance of an object.
at Sep.Git.Tfs.Core.TfsChangeset.GetPathBeforeRename(Item item) in C:\src\git-tfs\GitTfs\Core\TfsChangeset.cs:line 86

   at Sep.Git.Tfs.Core.TfsChangeset.Rename(Change change, String pathInGitRepo, GitIndexInfo index, IDictionary`2 initialTree) in C:\src\git-tfs\GitTfs\Core\TfsChangeset.cs:line 59
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(Change change, GitIndexInfo index, IDictionary`2 initialTree) in C:\src\git-tfs\GitTfs\Core\TfsChangeset.cs:line 44
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index) in C:\src\git-tfs\GitTfs\Core\TfsChangeset.cs:line 28
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass9.<Apply>b__7(GitIndexInfo index) in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 207
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in C:\src\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in C:\src\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in C:\src\git-tfs\GitTfs\Core\GitHelpers.cs:line 158
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in C:\src\git-tfs\GitTfs\Core\GitHelpers.cs:line 180
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in C:\src\git-tfs\GitTfs\Core\GitHelpers.cs:line 154
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in C:\src\git-tfs\GitTfs\Core\Gi tIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass9.<Apply>b__6() in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 207
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass18.<WithTemporaryIndex>b__17() in C:\src\git-tfs\GitTfs\Core\GitTfs Remote.cs:line 289
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 299
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 286
   at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 206
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch() in C:\src\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 120
   at Sep.Git.Tfs.Commands.Fetch.Run(IList`1 args) in C:\src\git-tfs\GitTfs\Commands\Fetch.cs:line 50
   at Sep.Git.Tfs.Commands.Clone.Run(IList`1 args) in C:\src\git-tfs\GitTfs\Commands\Clone.cs:line 34
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in C:\src\git-tfs\GitTfs\GitTfs.cs:line 46
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in C:\src\git-tfs\GitTfs\GitTfs.cs:line 29
   at Sep.Git.Tfs.Program.Main(String[] args) in C:\src\git-tfs\GitTfs\Program.cs:line 22

OutOfMemoryException

Started the process of pulling changes out of a good sized tfs repository and received an OutOfMemoryException.
It was at about TFS change 3000 of 7000 and the entire git repo (size on disk) had reached about 130 meg.

Is there a way to have it pick-up again where it was at?

TFS Branching

Hi,

One reason I tried out git-tfs, is because of git support for branching and how you can
view branching. However, when I imported our repository from TFS, the branches
were not converted to git branches.

I did not notice branching in the wish list. Am I doing something wrong, or is this not supported at the moment? (And are you planning to?)

Inconsistent File/Directory name case causes problems

I am cloning from a TFS repository that seems to have some inconsistency in the casing of directory names. This causes msysgit to believe there are untracked directories but it is impossible to add them to the index. After renaming the directory to a temporary name and renaming it back with the proper casing, it is possible to commit. Unfortunately, git tfs shelve fails with the following error:

The item $/SomeServer/CorrectCasing/somefile.txt already exists.
System.Exception: One item should have been added, but actually added 0 items.
     at Sep.Git.Tfs.Core.TfsWorkspace.Add(String path) in d:\projects\git-tfs\GitTfs\Core\TfsWorkspace.cs:line 5
7
     at Sep.Git.Tfs.Core.Changes.Git.Add.Apply(ITfsWorkspace workspace) in d:\projects\git-tfs\GitTfs\Core\Chang
es\Git\Add.cs:line 20
     at Sep.Git.Tfs.Core.GitTfsRemote.Shelve(String shelvesetName, String head, TfsChangesetInfo parentChangeset
, ITfsWorkspace workspace) in d:\projects\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 353
     at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1f.<Shelve>b__1e(ITfsWorkspace workspace) in d:\projects\
git-tfs\GitTfs\Core\GitTfsRemote.cs:line 346
     at Sep.Git.Tfs.VsCommon.TfsHelper.WithWorkspace(String localDirectory, IGitTfsRemote remote, TfsChangesetIn
fo versionToFetch, Action`1 action)
     at Sep.Git.Tfs.Core.GitTfsRemote.Shelve(String shelvesetName, String head, TfsChangesetInfo parentChangeset
) in d:\projects\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 345
     at Sep.Git.Tfs.Commands.Shelve.Run(IList`1 args) in d:\projects\git-tfs\GitTfs\Commands\Shelve.cs:line 45
     at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\projects\git-tfs\GitTfs\GitTf
s.cs:line 47
     at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\projects\git-tfs\GitTfs\GitTfs.cs:line 30
     at Sep.Git.Tfs.Program.Main(String[] args) in d:\projects\git-tfs\GitTfs\Program.cs:line 22

I am willing to bet that TFS is not case sensitive so it believes the item already exists. One possible solution might be to keep track of file/path names and then modify them so case is consistent.

tfs-fetch in cloned git repo getting entire history

I'm new in git, so not sure it is a problem with GitTfs and not with my understanding, but anyway...

We have rather large TFS server and mature project (4 year history). I made a git tfs clone successfully (several hours of thinking), then decided to make central bare repository with git clone --bare /my/local/path on server. After that I executed git tfs bootstrap and it is also finished successfully and determined last TFS check-in correctly. Then git remote rm origin because it doesn't need to track my dev box.

Soon after that I tried to run git tfs fetch - and it seems to hang. So I interrupted it and run git tfs fetch -d. It starts fetching from changeset 1 according to debug output. And my first repo (from which I cloned) is fetching just well:
info: refs/remotes/tfs/default: Getting changesets from 607891 to current ...

I noticed that bare repo missing tags and did git fetch --tags /my/local/path but it didn't help.

Am I doing something wrong or it is really a problem with GitTfs?
Thanks.

Null Reference in get_DisplayName

It's a windows Vista machine. I recently installed the msysgit and followed your directions. I got the same result with your precompiled version I found on your blog, and compiling the solution myself. After initially getting this error I also set my git config --global user.name with no luck.
I would really love for this to work. I'm posting the stack trace below in case you know what the problem is off hand.
Thanks
Eric

System.NullReferenceException: Object reference not set to an instance of an object.
at Sep.Git.Tfs.Core.TfsIdentity.get_DisplayName() in D:\Projects\my\git-tfs\GitTfs\Core\TfsIdentity.cs:line 22
at Sep.Git.Tfs.Core.TfsChangeset.GetAuthorName() in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 170
at Sep.Git.Tfs.Core.TfsChangeset.MakeNewLogEntry() in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 152
at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index) in D:\Projects\my\git-tfs\GitTfs\Core\TfsChangeset.cs:line 30
at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass9.b__7(GitIndexInfo index) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 207
at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action1 action) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21 at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12 at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 158 at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 180 at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action1 action, String[] command) in D:\Projects\my\git-tfs\GitTfs\Core\GitHelpers.cs:line 154
at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action1 indexAction) in D:\Projects\my\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12 at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass9.<Apply>b__6() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 207 at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass18.<WithTemporaryIndex>b__17() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 289 at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary2 newEnvironment) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 299
at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 286
at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 206
at Sep.Git.Tfs.Core.GitTfsRemote.Fetch() in D:\Projects\my\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 120
at Sep.Git.Tfs.Commands.Fetch.Run(IList1 args) in D:\Projects\my\git-tfs\GitTfs\Commands\Fetch.cs:line 50 at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList1 unparsedArgs) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 46
at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in D:\Projects\my\git-tfs\GitTfs\GitTfs.cs:line 29
at Sep.Git.Tfs.Program.Main(String[] args) in D:\Projects\my\git-tfs\GitTfs\Program.cs:line 22

After rebase in master to pull in changes from branch, git-tfs reports "nothing to check in"

Log of issue (paths and names redacted):

user@host /c/TFS/git/work/Solution (work-branch)
$ git commit --amend -C HEAD
[work-branch aec015a] My commit intended to be checked in to TFS
 7 files changed, 88 insertions(+), 61 deletions(-)

user@host /c/TFS/git/work/Solution (work-branch)
$ git checkout master
Checking out files: 100% (7/7), done.
Switched to branch 'master'

user@host /c/TFS/git/work/Solution (master)
$ git tfs pull
C125316 = 775b7d36e5284c2edf348ab9c4901db91375aa61
Updating 41c5656..775b7d3
Fast-forward
 Solution/Project2/Web.config | 1070 +++++++++++++++++++++--------------------
 1 files changed, 542 insertions(+), 528 deletions(-)

user@host /c/TFS/git/work/Solution (master)
$ git rebase work-branch
First, rewinding head to replay your work on top of it...
Applying: Upstream changeset from TFS

user@host /c/TFS/git/work/Solution (master)
$ git status -- .
# On branch master
nothing to commit (working directory clean)

user@host /c/TFS/git/work/Solution (master)
$ git tfs checkin --build-default-comment -f "none"
Nothing to checkin!

user@host /c/TFS/git/work/Solution (master)
$ git log --oneline --graph
* fede062 Upstream changeset from TFS
* aec015a My commit intended to be checked in to TFS
* 41c5656 (previous commit to mine)
* 9345b3a ...

user@host /c/TFS/git/work/Solution (master)
$ git tfs pull
Merge made by recursive.

user@host /c/TFS/git/work/Solution (master)
$ git tfs checkin --build-default-comment -f "none"
Nothing to checkin!

user@host /c/TFS/git/work/Solution (master)
$ git merge work-branch
Already up-to-date.

user@host /c/TFS/git/work/Solution (master)
$ git tfs checkin
Nothing to checkin!

user@host /c/TFS/git/work/Solution (master)
$ git tfs checkin aec015a
 edit Solution/Project1/Implementation/DAL/MyDatabase.dbml
Warning: There are other pending changes against the item.
 edit Solution/Project1/Implementation/DAL/Entities/DataObject1.Generated.cs
 edit Solution/Project1/Implementation/DAL/Entities/DataObject1.cs
 edit Solution/Project1/Implementation/DAL/Entities/DataObject2.Generated.cs
 edit Solution/Project1/Implementation/DAL/Queries/DataObject1Extensions.Generated.cs
 edit Solution/Project1/Implementation/DAL/Queries/DataObject2Extensions.Generated.cs
 edit Solution/Project1/Implementation/DataRepository/Core/Repository.DataObject.cs
[ERROR] Policy: Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered.). Installation instructions: To install this policy, follow the instructions in CheckForComments.cs.
[ERROR] Policy: You must associate this check-in with one or more work items.
No changes checked in.

user@host /c/TFS/git/work/Solution (master)
$ git tfs checkintool aec015a
 edit Solution/Project1/Implementation/DAL/MyDatabase.dbml
Warning: There are other pending changes against the item.
 edit Solution/Project1/Implementation/DAL/Entities/DataObject1.Generated.cs
 edit Solution/Project1/Implementation/DAL/Entities/DataObject1.cs
 edit Solution/Project1/Implementation/DAL/Entities/DataObject2.Generated.cs
 edit Solution/Project1/Implementation/DAL/Queries/DataObject1Extensions.Generated.cs
 edit Solution/Project1/Implementation/DAL/Queries/DataObject2Extensions.Generated.cs
 edit Solution/Project1/Implementation/DataRepository/Core/Repository.DataObject.cs
TFS Changeset #125321 was created. Marking it as a merge commit...
C125321 = 4bf5ec1055055c1c5e161c2d04527424fab581da

I'm expecting git-tfs to detect my rebased commit and prepare a TFS changeset for that but it did not. Perhaps the git tfs pull which pulled in the new commit threw off checkin somehow.
git tfs checkin <commitid> did not work either. TFS noticed the changes but said there was nothing to check in.

It finally worked when I used git tfs checkintool <commitid>.

FYI, I have both "VS Team System 2008 Development Edition" and "VS2010 Premium" installed on this machine.

Should we clone into an existing workspace

TFS uses workspaces to map folders to source control. When using git-tfs, should we clone into the workspace, or create a new folder?

For example, I have
C:\Dev\Company\ProjectA\
mapped to a workspace. Should I git clone in that folder, or should I create a
C:\Dev\Company\ProjectA-git
folder?

The documentation is unclear on this
cd where\you\keep\your\code
git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

Commits from TFS cannot be pushed/pulled safely

Suppose we have remote TFS server (relatively slow connection), central bare git repository called test-central and two developer's repositories called test-dev-1 and test-dev-2.

  1. test-central has some history from TFS downloaded, test-dev-1 and test-dev-2 were cloned and bootstrapped from test-central thus sharing start history.
  2. After that some checkins are made to TFS from outside. test-dev-1 spotted this and executed git tfs pull to his master branch. And pushed it to test-central so that others can to download from local net without round-tripping to TFS.
  3. test-dev-2 doing exactly the same as test-dev-1 except that his last push fails because there're already commits from test-dev-1.

See scenario below
[test-central]
git tfs clone <tfs_url> test-central
cd test-central
--- git tfs clone doesn't have --bare option so removed everything except .git folder,
--- moved contents in parent folder and executed this command
git config --bool core.bare true

[test-dev-1]
git clone test-central test-dev-1
cd test-dev-1
git tfs bootstrap
--- here someone checked in smth new to TFS
git tfs pull
--- several new commits appear and master fast-forwarded to their tail
git push
--- push to test-central/master succeeded as fast-forward

[test-dev-2]
git clone test-central test-dev-2
--- there's no new commits yet
cd test-dev-2
git tfs bootstrap
--- here someone checked in smth new to TFS
git tfs pull
--- several new commits appear and master fast-forwarded to their tail
git push
--- push to test-central/master fails as there're already test-dev-1's commits with different hashes!

As I can see the problem is that commits pulled directly from TFS are commited to git repo with correct author name (taken from TFS actually), but current user's email. Thus they have different hashes on test-dev-1 and test-dev-2 pulls.

My understanding is that setting some constant stub email (tfs-instance-name@email for example) on git tfs fetch and git tfs pull will solve this problem. Am I right?

GitTfsTest.Vs2010 references Vs2008 unit test framework

I opened the solution on my dev machine, which only has Vs2010 and .NET 4.0 installed. I unloaded the Vs2008 specific projects. When I build, I get an error, "the namespace VisualStudio is not found...". I looked at the GitTfsTest.Vs2010 project file and realized that it's referencing the 9.0 version of the unit test framework. It should be referencing the 10.0 (or 10.1) version.

I would fork, fix, and do a pull thingie, but Visual Studio is freaking out and creating VSMDIs which is changing the sln file and messing with git.

clone throws exception on a changeset with a large file

I get the following exception when running a clone with version 0.10.0. It seems to choke up on a changeset with one large file that is ~20k lines long.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sep.Git.Tfs.Core.GitCommandException: Command exited with error code. at Sep.Git.Tfs.Core.GitHelpers.Close(Process process) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 196 at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClass8.<CommandOutputPipe>b__7() in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 58 at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 182 at Sep.Git.Tfs.Core.GitHelpers.CommandOutputPipe(Action 1 handleOutput, String[] command) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 53 at Sep.Git.Tfs.Core.GitHelpers.CommandNoisy(String[] command) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 45 at Sep.Git.Tfs.Core.GitTfsRemote.DoGcIfNeeded() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 180 at Sep.Git.Tfs.Core.GitTfsRemote.Fetch(Dictionary 2 mergeInfo) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 130 at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 64 at Sep.Git.Tfs.Commands.Fetch.Run(String[] args) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 57 at Sep.Git.Tfs.Commands.Fetch.Run() in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 49 at Sep.Git.Tfs.Commands.Clone.Run(String tfsUrl, String tfsRepositoryPath, String gitRepositoryPath) in d:\dev\github\git-tfs\GitTfs\Commands\Clone.cs:line 39 at Sep.Git.Tfs.Commands.Clone.Run(String tfsUrl, String tfsRepositoryPath) in d:\dev\github\git-tfs\GitTfs\Commands\Clone.cs:line 33 --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList 1 args) in d:\dev\github\git-tfs\GitTfs\Util\GitTfsCommandRunner.cs:line 36 at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList 1 unparsedArgs) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 56 at Sep.Git.Tfs.GitTfs.Run(IList 1 args) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 39 at Sep.Git.Tfs.Program.Main(String[] args) in d:\dev\github\git-tfs\GitTfs\Program.cs:line 22

Exception "System.InvalidOperationException: Sequence contains no elements" in TfsChangeset.cs

Not sure what exactly is going on here, but here is what the debug log says (during a fetch):

git command: Starting process: git config -l
git command time: [00:00:02.2500576] config -l
Fetching from TFS remote default
git command: Starting process: git log --no-color --pretty=medium refs/remotes/tfs/default
git command time: [00:00:01.8750480] log --no-color --pretty=medium refs/remotes/tfs/default
info: refs/remotes/tfs/default: Getting changesets from 415343 to current ...
git command: Starting process: git write-tree
git command time: [00:00:00.7187684] write-tree
git command: Starting process: git cat-file commit ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command time: [00:00:00.0781270] cat-file commit ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command: Starting process: git update-index -z --index-info
git command: Starting process: git ls-tree -r -z ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command time: [00:00:04.7032454] ls-tree -r -z ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command: Starting process: git ls-tree -r -d -z ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command time: [00:00:05.1407566] ls-tree -r -d -z ee47e36a549ed9910b45656ba05ad7ac4596a3da
git command time: [00:00:15.9066572] update-index -z --index-info
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Sep.Git.Tfs.Core.TfsChangeset.GetPathBeforeRename(IItem item) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 93
   at Sep.Git.Tfs.Core.TfsChangeset.Rename(IChange change, String pathInGitRepo, GitIndexInfo index, IDictionary`2 initialTree) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 59
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(IChange change, GitIndexInfo index, IDictionary`2 initialTree) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 44
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 28
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.<Apply>b__6(GitIndexInfo index) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 225
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 160
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 182
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 156
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.<Apply>b__5() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 225
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1c.<WithTemporaryIndex>b__1b() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 318
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 328
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 315
   at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 224
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch(Dictionary`2 mergeInfo) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 126
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 64
   at Sep.Git.Tfs.Commands.Fetch.Run(String[] args) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run() in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 49
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in d:\dev\github\git-tfs\GitTfs\Util\GitTfsCommandRunner.cs:line 36
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 56
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 39
   at Sep.Git.Tfs.Program.Main(String[] args) in d:\dev\github\git-tfs\GitTfs\Program.cs:line 22
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Sep.Git.Tfs.Core.TfsChangeset.GetPathBeforeRename(IItem item) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 93
   at Sep.Git.Tfs.Core.TfsChangeset.Rename(IChange change, String pathInGitRepo, GitIndexInfo index, IDictionary`2 initialTree) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 59
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(IChange change, GitIndexInfo index, IDictionary`2 initialTree) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 44
   at Sep.Git.Tfs.Core.TfsChangeset.Apply(String lastCommit, GitIndexInfo index) in d:\dev\github\git-tfs\GitTfs\Core\TfsChangeset.cs:line 28
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.<Apply>b__6(GitIndexInfo index) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 225
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(TextWriter stdin, IGitRepository repository, Action`1 action) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 21
   at Sep.Git.Tfs.Core.GitIndexInfo.<>c__DisplayClass1.<Do>b__0(TextWriter stdin) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitHelpers.<>c__DisplayClassb.<CommandInputPipe>b__a() in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 160
   at Sep.Git.Tfs.Core.GitHelpers.Time(String[] command, Action action) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 182
   at Sep.Git.Tfs.Core.GitHelpers.CommandInputPipe(Action`1 action, String[] command) in d:\dev\github\git-tfs\GitTfs\Core\GitHelpers.cs:line 156
   at Sep.Git.Tfs.Core.GitIndexInfo.Do(IGitRepository repository, Action`1 indexAction) in d:\dev\github\git-tfs\GitTfs\Core\GitIndexInfo.cs:line 12
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass8.<Apply>b__5() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 225
   at Sep.Git.Tfs.Core.GitTfsRemote.<>c__DisplayClass1c.<WithTemporaryIndex>b__1b() in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 318
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryEnvironment(Action action, IDictionary`2 newEnvironment) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 328
   at Sep.Git.Tfs.Core.GitTfsRemote.WithTemporaryIndex(Action action) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 315
   at Sep.Git.Tfs.Core.GitTfsRemote.Apply(String lastCommit, ITfsChangeset changeset) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 224
   at Sep.Git.Tfs.Core.GitTfsRemote.Fetch(Dictionary`2 mergeInfo) in d:\dev\github\git-tfs\GitTfs\Core\GitTfsRemote.cs:line 126
   at Sep.Git.Tfs.Commands.Fetch.DoFetch(IGitTfsRemote remote) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 64
   at Sep.Git.Tfs.Commands.Fetch.Run(String[] args) in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 57
   at Sep.Git.Tfs.Commands.Fetch.Run() in d:\dev\github\git-tfs\GitTfs\Commands\Fetch.cs:line 49
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in d:\dev\github\git-tfs\GitTfs\Util\GitTfsCommandRunner.cs:line 36
   at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 56
   at Sep.Git.Tfs.GitTfs.Run(IList`1 args) in d:\dev\github\git-tfs\GitTfs\GitTfs.cs:line 39
   at Sep.Git.Tfs.Program.Main(String[] args) in d:\dev\github\git-tfs\GitTfs\Program.cs:line 22

MyTestGitRepo.git\tfs\default\workspace is already mapped in workspace LAP-234.

Hi,

occasionally running git tfs shelve does not work for me.
Running git tfs cleanup-workspace does not fix the issue.

I used git tfs quick-clone url TestDevStreamRepo to get the file from TFS - this worked
I used git tfs pull to bring down changes from TFS - this worked.
I changed a file in the git repo and committed locally.
Then I attempted to send it to TFS via git tfs shelve

C:\Workspace\GitPOC\TestDevStreamRepo>git tfs shelve sfgsf

The path C:\Workspace\GitPOC\TestDevStreamRepo.git\tfs\default\workspace is already mapped in workspace LAP-234.
You may be able to resolve this problem.

  • Run 'git tfs cleanup-workspace' to remove the workspace.

Would anyone know what the issue may be here?

Cheers
Mike

One-to-one mapping between git commits and TFS checkins

Is there a way to check my git commits into TFS as separate changesets, rather than a big changeset that includes all my work since last push? I'm talking about master branch only, it's ok if a merge from a local branch go as as single changeset.

I'm used to keep my changesets as small as possible. I followed this rule in TFS before, I keep doing it in git, but now I can't find an easy way to keep my TFS history fine grained.

Update: I've tried the following pattern: I keep a local branch called "local". I work there, make commits. For example, I have two commits there C1 and C2 and now I want to push them to TFS. I merge C1 to master, then check it in. Then I merge C2 to master, check it in again. It works, but the change log is screwed up. Try it yourself.

Thanks

specifying tfs layout

My TFS2010 has the following structure:

$/MyProject
$/MyProject/Crap
$/MyProject/Src/MainTrunk
$/MyProject/Src/Branch1
$/MyProject/Src/Branch2

How can I load trunk and branches as valid git structure?

git tfs init --trunk=Src/MainTrunk --branches=Src http://tfs_url_here $/MyProject

did not work. Note: I do not want anything above Src subfolder (e.g. $/MyProject/Crap should not be in git)

git tfs pull with uncommitted changes

Doing a pull when there are uncommitted changes will result in an exception. In some cases we've found the only way to resolve the issue is to re-clone. I believe this will only happens if the pull has a file conflict with something already on local.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.