If you are running Team System, there is feature in the source control option in your project level settings that you should be aware of. Right click your team project in the Project Explorer window of Visual Studio.
Go here:
And get this screen.
Why? Because if you have made some changes to a file while it wasn’t checked out, you will not have the option to merge to your local machine. This option will simply overwrite your local code file.
Why does this feature exist? Because oodles of people asked for it because they were used to it in Source Safe, and the team relented.
Repeat: This is a bad idea!
If, however, you are a person who simply must have this turned on in order to feel snug, there is a way to do it without making your entire team experience the hell that will be yours.
In Visual Studio, go to Tools > Options > Source Control > Environment and do this:
I warned you.
This is bullshit advise. We had this setting off which is default and TONs of trouble with it. People used check out, change file thinking that its latest and try to check in just to find out dozens of merge to resolve. VS is not good at merge especially when it comes to XAML etc and even just plain code. I myself found many times that when I select Resolve automatically, VS actually messes things up. Think about surprises at last minute of build and all the unit testing you have repeat. This option really saved us. It makes sure we have latest when we check out and hence minimal merge issues later. As far as ability of changing file without checking out is concerned – I think it would be useful if your developers are always traveling and only time they get for writing code is in airplains. Our devs write code in real office buildings and they have connection to TFS 99% of the time. So we enforce getting latest checking out before they start making changes and that minimized merging issue by huge margin. So please stop thinking everybody is writing code in airport and spreading practises suitable to only that situation. Thank you.
1. You have a potty mouth 🙂
2. If you were having trouble without it, you weren’t doing a “Get Latest” before you commit code. Shame, shame.
3. This problem gets worse with a complex branching strategy.
I also have this “feature” disabled. I have never had an issue with merging manually when the time comes to check in. If you are in the habit of getting latest and building before you check in (which every dev who uses a centralised VCS should be) then there’s really no need to have this turned on.
I can’t help but notice a lack of references to airports, disconnected environments or anything of that nature in this post. I also fail to see how this “practice” would only be suitable to situations of that ilk. So, lurker, I believe you’re talking out of your rear (with all due respect ;)).
Cheers!