Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
git tfs clone http://tfsprod:8080/tfs/Marine%20Safety/ $/MPDIS-SDDPM_Scrum/DEVELOPMENT/MPDIS-SDDPM c:\tmp\migration\mpdis --branches=all


Tip

If your branch happens to have spaces in the name, put quotes ("") around it.  Eg. git tfs clone http://tfsprod:8080/tfs/Marine%20Safety/ "$/Some branch name with spaces in it/DEVELOPMENT/MPDIS-SDDPM" c:\tmp\migration\mpdis --branches=all


Warning

If your codebase in TFS has sensitive information (eg. passwords), do not include them in your Azure Devops repository.  You can do one of two things:

  1. Remove them from the codebase, check the changed files back into TFS and then be sure to clone the latest code only (step #8).  You will lose all history in this case.
  2. If you clone all history (as in step #9), the passwords will still be available in the repo history.  Remove the culprit files from history as follows:
    1. In the cmd shell, navigate to your repo's folder (in the above example it was c:\tmp\migration\mpdis).
    2. (See this page for more detail regarding this step).   Run the following making sure to change the path-to-the-file to the actual path to the file (eg. src/web.config):  git filter-branch --force --index-filter "git rm --cached --ignore-unmatch path-to-the-file" --prune-empty --tag-name-filter cat -- --all
    3. You've now removed the culprit files from history.  You can re-create and add them to the repository later with sensitive information removed if you'd like.

NOTE: If there is a space in a folder name in path-to-the-file, place a slash"\" before the space. E.g. if the path is  My Project/Settings.settings, change it to My\ Project/Settings.settings. Otherwise, the above command does not remove specified file.

...