Подтвердить что ты не робот

Как очистить знания сервера TFS от моей локальной версии?

У нашего создателя возникли проблемы с компиляцией исходного кода, который проверен в нашем экземпляре TFS.

Я работал над некоторыми изменениями, которые я не был готов к регистрации, поэтому сделал резервную копию моей локальной папки вручную и удалил содержимое моей локальной папки. Затем я сделал "Получить последнюю - конкретную версию, с перезаписью", чтобы я получил последнюю. И убедитесь, что он скомпилирован (это было, проблема была проблемой установки на машине сборки).

Итак, теперь, если я вручную переименую папки локально, чтобы вернуться к моей версии, у меня есть проблема, что TFS думает, что у меня есть самый последний источник... чего я не делаю. Файлы были изменены другим разработчиком, но так как я сделал "Получить последнюю - конкретную версию с переписыванием", он считает, что мой код полностью обновлен.

Вопросы:

  • Может ли кто-то сказать "tfs, что мои локальные версии не являются последними? (Я думаю, что я мог бы сделать это с помощью утилиты tds cmd, но не совсем уверен, какой)

  • Был ли другой способ сделать это?

Спасибо.

4b9b3361

Ответ 1

Вы можете удалить/удалить локальное рабочее пространство.

Проводник управления источником → Распространение рабочей области → Рабочие области → Удалить

Ответ 2

Если вы получите конкретную версию Changeset "1" вашего исходного кода, TFS удалит локальные файлы и будет считать, что в вашей рабочей области больше нет последнего кода. Затем, когда вы получите последний, он на самом деле получит последний.

Ответ 3

В будущем вместо создания ручной копии создайте полку. В окне "ожидающие изменения" нажмите "Shelve" и следуйте за диалогом (в этом случае вы не хотите, чтобы ваши ожидающие изменения были локально). Это помещает вашу работу на сервер в безопасное, восстанавливаемое место, но не проверяя его.

Кроме того, в раскрывающемся списке рабочей области вы можете создать вторую рабочую область. Это дает вам две отдельные копии кода локально, но также два отдельных набора проверок. Это действительно полезно, если вы часто находите, что прерываете одну часть работы, чтобы посмотреть на что-то еще.

Если вы сделаете еще один "конкретный" с переписыванием, это все равно устранит вашу проблему.

Ответ 4

Знаете ли вы, какие файлы были изменены? Мы говорим много файлов? Или всего несколько?

Если это всего лишь несколько, то вам нужно просто скопировать измененную версию обратно, а затем переустановить файлы. Затем TFS зарегистрируется, чем вы изменили эти файлы.

Если у вас много измененных файлов, я рекомендую вам дать Инструменты Team Foundation Power Tools (tfpt) Онлайн-команда "Командная строка" a попробуйте.

Справка командной строки можно увидеть здесь.

Вот еще информация от Бака Ходжеса:

Online

With Team Foundation, a server connection is necessary to check files in or out, to delete files, to rename files, etc. The TFPT online tool makes it easier to work without a server connection for a period of time by providing functionality that informs the server about changes made in the local workspace.

Non-checked-out files in the local workspace are by default read-only. The user is expected to check out the file with the tf checkout command before editing the file. When working in this

When working offline with the intent to sync up later by using the TFPT online tool, users must adhere to a strict workflow: 

    * Users without a server connection manually remove the read-only flag from files they want to edit. Non-checked-out files in the local workspace are by default read-only, and when a server connection is available the user must check out the file with the tf checkout command before editing the file. When working offline, the DOS command "attrib –r" should be used.
    * Users without a server connection add and delete files they want to add and delete. If not checked out, files selected for deletion will be read-only and must be marked as writable with "attrib –r" before deleting. Files which are added are new and will not be read-only.
    * Users must not rename files while offline, as the TFPT online tool cannot distinguish a rename from a deletion at the old name paired with an add at the new name.
    * When connectivity is re-acquired, users run the TFPT online tool, which scans the directory structure and detects which files have been added, edited, and deleted. The TFPT online tool pends changes on these files to inform the server what has happened.  

To invoke the TFPT online tool, execute 

tfpt online

at the command line. The online tool will begin to scan your workspace for writable files and will determine what changes should be pended on the server.

By default, the TFPT online tool does not detect deleted files in your local workspace, because to detect deleted files the tool must transfer significantly more data from the server. To enable the detection of deleted files, pass the /deletes command line option.

When the online tool has determined what changes to pend, the Online window is displayed.

Individual changes may be deselected here if they are not desired. When the Pend Changes button is pressed, the changes are actually pended in the workspace.

Important Note: If a file is edited while offline (by marking the file writable and editing it), and the TFPT online tool pends an edit change on it, a subsequent undo will result in the changes to the file being lost. It is therefore not a good idea to try pending a set of changes to go online, decide to discard them (by doing an undo), and then try again, as the changes will be lost in the undo. Instead, make liberal use of the /preview command line option (see below), and pend changes only once.

Preview Mode

The Online window displayed above is a graphical preview of the changes that will be pended to bring the workspace online, but a command-line version of this functionality is also available. By passing the /preview and /noprompt options on the command line, a textual representation of the changes that the TFPT online tool thinks should be pended can be displayed.

tfpt online /noprompt /preview

Inclusions

The TFPT online tool by default operates on every file in the workspace. Its focus can be more directed (and its speed improved) by including only certain files and folders in the set of items to inspect for changes. Filespecs (such as *.c, or folder/subfolder) may be passed on the command line to limit the scope of the operation, as in the following example:

tfpt online *.c folder\subfolder

This command instructs the online tool to process all files with the .c extension in the current folder, as well as all files in the folder\subfolder folder. No recursion is specified. With the /r (or /recursive) option, all files matching *.c in the current folder and below, as well as all files in the folder\subfolder folder and below will be checked. To process only the current folder and below, use

tfpt online . /r

Exclusions

Many build systems create log files and/or object files in the same directory as source code which is checked in. It may become necessary to filter out these files to prevent changes from being pended on them. This can be achieved through the /exclude:filespec1,filespec2,… option.

With the /exclude option, certain filemasks may be filtered out, and any directory name specified will not be entered by the TFPT online tool. For example, there may be a need to filter out log files and any files in object directories named "obj".

tfpt online /exclude:*.log,obj

This will skip any file matching *.log, and any file or directory named obj.

Ответ 5

Я использую взломы с открытием решения без сетевого подключения (отсоедините кабель, выключите Wi-Fi), и решение будет открыто в автономном режиме.

Для этого есть плагин под названием "выйти в автономный режим".

И затем вы нажимаете "выходить в онлайн", который автоматически отображается, в случае автономного решения.

После этого VS проверит все ваши локальные файлы на TFS и автоматически проверит файлы, которые были изменены.

Но для вашего случая я бы также предложил использовать полки.

Ответ 6

в TFS 2013+ и VS 2015+ у вас есть опция Cloak, которая удаляет локальные файлы и скрывает эти ветки от загрузки в локальную рабочую область (в основном, отключает определенные ветки)