1

After getting a specific version of the project and making some changes, I want to commit these changes and ensure that no files change and my local copy becomes the latest version that people can pull.

Oops. Looks like something similar was asked here:

How to get specific changeset version treated as changes relative to latest version?

Jack Fairfield
  • 1,876
  • 22
  • 25
  • Which version control system are you using,TFVC or Git? Did you just want to temporarily block others commits/changes o to the server during your working on the project? And after the work have done, others then pull down yours version of the project. – PatrickLu-MSFT Jan 09 '18 at 09:15
  • 1
    @PatrickLu-MSFT I don't actually want to lock any files. I just don't want the latest changes to get mixed into my current version when I do the merge to commit my changes. When I attempt the merge, usually it will automatically take the newest version of each file. How can I make it take my files? I am using TFVC. – Jack Fairfield Jan 09 '18 at 15:13
  • Hi Jack, it's not able to do this , when you commit your local changes, TFS will automatically compare your local changes with "the latest" version, it will not pick up the specific version, you have to solve the conflicts manually. Unless you directly roll back your changeset to the specific version you got. Another workaroud, just like jesse mentioned in above link, you could use shelveset to store the specific version code and get latest on your local workspace, resolve the conflicts first locally, Then you don't have to solve it when commit. Details please see my update answer below. – PatrickLu-MSFT Jan 09 '18 at 15:37

2 Answers2

2

Update

It's not able to do this , when you commit your local changes, TFS will automatically compare yours local changes with "the latest" version on sever, it will not pick up the specific version, you have to solve the conflicts manually. Unless you directly roll back your changeset to the specific version you got.

Another workaround, just like jesse mentioned in above link, you could use shelveset to temporarily store the specific version code and get latest on your local workspace, resolve the conflicts locally first. Then you don't have to solve it when you do the commit.

To sum up, there are changes between the specific version/changeset with "the latest", you have to resolve the conflicts, either when you pull files down to workspace or commit back to server. Unless you commit your changes to server, other people could be able to pull your version.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
1

Generally you just need to check in/commit these changes to remote TFS repository, but you may need to resolve the conflicts (conflicts between your local version and the current latest version) during the check in. Just keep the local version When resolve the conflicts. See Resolve Team Foundation Version Control conflicts for details.

Another workaround is creating a new branch, then check in/commit your local version to the new branch. Thus it becomes the latest versiont on the specific new branch. And team members can get latest from this new branch.

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55