Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shelving and then Undo pending changes

I'm new at TFS in Visual Studio and I want to understand something about Shelve and Undo.
Let guess I checked out some files, made some changes and then shelved them.
In that moment - the source code which was before I made changes is restore to original code so all the team members won't see my changes?
-- or --
they see the modified code until I Undo pending changes?
And if I undo the changes - will it affect my shelvset?

like image 967
arii Avatar asked Feb 06 '23 18:02

arii


2 Answers

So you need to understand what is actually happening. When you make changes, they only exists on your machine until you check them in to the repository. A shelveset provides a "safe" place for you to store your changes before you check them in.

The rest of the team won't see your changes until you check them in to the repository. So when you undo changes it is merely the changes that you made to your code that is on your machine.

In your example above, your team won't see any changes until you actually check it in.

like image 69
Niel Zeeman Avatar answered Feb 14 '23 09:02

Niel Zeeman


Changes in Shelvesets can be seen by the other team members, but they are not committed to the repository. They would have to go to Pending Changes -> Actions -> Find Shelveset and type you name in the user search box.

Only when you do a check-in, will others see your changes in the repository.

Undo will remove the changes locally, but the shelveset will remain so that you or anyone on the team can get the changes back locally.

like image 38
Tore Østergaard Avatar answered Feb 14 '23 10:02

Tore Østergaard