Reputation: 412
I have two instances of TFS, one 2012 and the other 2013. My goal is to export some source code from the 2012 instance and import it into the 2013 instance, preserving the check in history.
The method I'm employing is;
$ git tf clone http://old-tfs-host:8080/DefaultCollection $/myProject/myBranch --deep
$ git tf configure --deep --keep-author --force http://new-tfs-host:8080/DefaultCollection $/myProject/myBranch
$ git tf pull
$ git commit -a -m "Initial import from TFS 2012"
$ git tf checkin --deep
I get an error after processing about 57%
git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in. The item $/path-to-file already has pending changes.
Question - how do I resolve pending changes for the file? No one else is in the repository while I am doing this check-in so it would seem that the export may be corrupted?
I have used this same method for two other branches and have been successful.
EDIT I found that the issue is a file was renamed with the only difference being case. So in the same change I have
delete $/source-file
edit $/project-file
add $/Source-File
Obviously I am renaming them, but the file deleted in line 1 is the same as the file in line 3 with the only difference being file name case.
So I have tried $ git config --global core.ignorecase false
but that does not resolve the issue of both deleting and adding the same file in the same change.
Upvotes: 2
Views: 1489
Reputation: 153
I had the same problem, which occurs when you delete, add and edit the same file in one changeset.
if you do git tf checkin --preview
you will see the details.
I solved it by doing:
git tf checkin --deep --renamemode=none
Upvotes: 4
Reputation: 31651
We had a similar issue with Git-TF when running git tf checkin
, tinkering with the renamemode
did not work:
failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in
The resolution involved bypassing the pendChanges()
check in PendDifferenceTask.java
to essentially --force
it in.
if (count < deleteSpecs.length)
{
log.debug("Failed to pend Delete changes...ignoring count mismatch. Expected: " + deleteSpecs.length + ", Actual: " + count);
//throw new Exception(Messages.getString("PendDifferencesTask.PendFailed")); //$NON-NLS-1$
}
This change will require a rebuild via maven (mvn package -DskipTests
) for quick JAR snapshot creation.
BTW..if you want to enable debugging in Git-TF, update your git-tf.cmd
to the following, this helped tremendously:
java -ea -Xmx512M -Dlog4j.configuration=file:///C:\git-tf\log4j.xml -cp %GITTF_CLASSPATH% "-Dcom.microsoft.tfs.jni.native.base-directory=%BASE_DIRECTORY%native" com.microsoft.gittf.client.clc.Main %*
Then just create a log4j.xml
that looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} %5p %t %c{1}:%L - %m%n"/>
</layout>
</appender>
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="file" value="mycorp.myapp.log"/>
<param name="MaxFileSize" value="100000KB"/>
<!-- Keep one backup file -->
<param name="MaxBackupIndex" value="4"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %l - %m%n"/>
</layout>
</appender>
<root>
<level value="debug"/>
<!--<appender-ref ref="stdout"/>-->
<appender-ref ref="FILE"/>
</root>
</log4j:configuration>
If you want to graphically view your TF changesets on windows - I suggest installing Atlassian sourcetree - it made troubleshooting much easier than git log
.
Upvotes: 1