Remove already checked in files now in .tfignore file

北慕城南 提交于 2019-12-24 03:29:09

问题


I have a developer who has been checking in everything info his TFS branch. Now that i have my hands on his branch i noticed he had no .tfignore file and the bin and package folders and files are all in source control currently. I have implemented a .tfignore file to exclude these files in the future but also want the newly ignored files and folders to be removed from source control.

Is there a command or function in TFS that will "reconcile" (remove and ignore) newly ignored files and folders based on the .tfignore file? Essentially cleaning up the branch? Or is there a specific process i can follow to manually do this, i.e. going into Source Control Explorer, manually deleting the offending files and folders and then doing a fresh checkin with the ignore rules in place? I'm nervous of this approach as i have a feeling TFS will not recognize this move as changes on my local solution....

Any insight and advice on this would be welcome!

Thanks


回答1:


First .tfignore file will not affect with those files already in source control. And just like Richard mentioned there is not a command or function in TFS that will "reconcile" (remove and ignore) newly ignored files and folders based on the .tfignore file.

You have to manually remove the files/folder from Source Control Explorer.

If i remove the folder from Source Control Explorer, checkin the delete of the folder, then rebuild the folder locally (with the .tfignore file in place), will TFS allow me to then checkin the non-ignored files?

Suggest you destroy those files instead of just deleting them in TFS. Then delete your local workspace and recreate it. Be careful not to delete your local files without creating a backup. Get latest from TFS, then rebuild the folder locally. This is the most secure way.




回答2:


Is there a command or function in TFS that will "reconcile" (remove and ignore) newly ignored files and folders based on the .tfignore file?

No (unfortunatelly).

You are on your own (but it would be a good feature to have).



来源:https://stackoverflow.com/questions/44073534/remove-already-checked-in-files-now-in-tfignore-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!