This project is read-only.

checkin a commit which moves a file from a folder which is to be deleted

Nov 12, 2012 at 7:08 PM

I'm running into a problem checking in a particular commit using git-tf. The problematic commit involves moving (renaming) a file which is a child of a folder which is to be deleted. Apparently this is a no-no in TFS (see this Stack Overflow post).

In the future, I will obviously try to avoid doing this in a single commit on the git side. But since I've already made this error, I need to figure out a way around it to get the git-tf checkin to work. I'm relatively new to git, so maybe there's a simple solution. Seems like I need to somehow go back and "split" the offending commit into two parts: one where the file is moved/renamed out of the folder, and one where the folder is deleted. Or maybe there's something I can do on the TFS side to make it happy.

The error TFS is throwing is as follows: TF14060: The item $/blah/... cannot be deleted. One or more children have pending changes.

Any ideas?

Nov 12, 2012 at 7:11 PM

To get past this error you can try the following

git tf checkin --renamemode=justFiles

What this will do is that it will rename the files that need to be renamed but leave the empty folders behind in TFS.

Let us know if this does not work for you and we can look at the exact changes and figure out another way to get it in TFS.



Nov 12, 2012 at 7:21 PM

Thanks so much for the quick reply.  I was able to successfully commit with this option.  

As you said would happen, I now have the empty folder left on TFS.  Is it safe to delete the folder on the TFS side and do a "git-tf pull" to get TFS and git fully in sync?


Nov 12, 2012 at 7:23 PM

Yes that would be safe, I am glad that worked.

Please let us know if you hit any other issues with git tf :)