Git with TFS and exclusive checkouts - visual-studio-2010

I would like some advice on how to use Git locally on my computer along with Visual Studio and a TFS server. Unfortunately the technical leader of my company has set TFS with the exclusive check-out policy and so every time someone checks out a file, it can't be edited by someone else.
What is the right way to make the two systems live together? I would try to use Git-TF but I'm not convinced with the checkin phase. The workflow should be as the following:
clone the project
switch to offline mode for Visual Studio
work offline with Git
fetch from the TFS server and rebase
check-in?
The problem is: how do I check-in my files if someone else has already checked out the files I need to change? How does Git-TF really work when checking-in files?
Another workflow that came to my mind, without Git-TF, could be the following:
open the TFS project
switch to offline mode
create a new branch with Git
work on the branch
return to the master branch, update it
exclusively checkout the files which have been changed on my Git branch
merge the branch on master
check in with TFS (after switch to online mode?)
What do you recommend?

Related

How to force TFS server to take all of my local files?

I have a couple of ASP.NET Core based projects being developed using Visual Studio 2019.
I am having issues where my workspace and TFS server on Azure-DevOps are out of sync. My PC contains the most recent code and I want to push everything I have on the server. I don't really care about the status of the TFS server as it is wrong. I just want to force everything to get pushed to ensure my PC and TFS are syncing again.
How can I force the TFS on Azure-DevOps to take all my files? I don't even mind removing the project altogether from Azure-DevOps and push all files as if this is a new project.
According to your description, sounds like there is something wrong with your source control binding. Or maybe some files outside of Visual Studio do not detect by TFS server. Which cause your workspace and TFS server out of sync.
If you want TFS server detect changes done to files outside of Visual Studio, the simplest way is using local workspace.
Now anything else changes files outside Visual Studio, your workspace detects the changes automatically.
It also detects adds or deletes but you have to include them to your Pending Changes manually with the link under `Excluded Changes
If you are using server workspace, this is kind like when you are offline, you cannot work with your local files because they are read-only until you check them out. So highly recommend you switch to local workspace, you just need to make sure you open the files in VS from a path which the same as your TFS local worksapce. Then it will auto sync changes in Visual Studio and show in pending changes.
More detailed information on the pros and cons of local and server workspaces, please refer our official link.
Now in your situation, we suggest you fist back up all of your local codes/files first. Then delete your old workspace, create a new local workspace.
Get latest from your sever, then copy all your back up to your workspace folder. Then let windows file system auto detect the difference between them, replace files download from server with your back up local version.
Now your local workspace should contain the latest version of your code/file, Visual Studio will auto detect the changes and list them in pending changes, if something added in excluded list, manually promote them.
Finally you could just check in/push all pending changes to TFS server. Now everything back to the track again.
Hope this helps.

AnkhSVN Merging Trunk into Branch

I'm trying to merge changes from a Trunk into a Branch. Previously when I've tried this everything has worked perfectly however in this instance the merge wizard has a cross next to "No uncommitted changes" and will not let me proceed. I've done everything I can think of to resolve this but as I have no entries in my "Pending changes" window I'm at a loss as to what could be the problem!
Any help or guidance on what to try next would be very much appreciated! I'm using Visual Studio 2012 with the latest stable 2.4 AnkhSVN release.
TL:DR - Downloaded TortoiseSVN and used it and VisualSVN server console to see exactly what was going on.
This was impossible to resolve with AnkhSVN alone. I downloaded TortoiseSVN and inspected the solution - turns out I had a tree conflict with one of my folders that had been renamed - logged into the VisualSVN Management server and deleted the "old" (original named) folder directly and pulled an update.
The next issue I discovered was the "obj" folder had somehow crept into the mix which was causing problems as visual studio loves updating files in here and so there were ALWAYS files to commit. Used TortoiseSVN to "Unversion and add to ignore list" on all the obj folders (Have about five projects in the solution that this had happened to!) and committed.
Once these steps had been taken I was able to update within Visual Studio using AnkhSVN and then use the AnkhSVN merge wizard to pull the changes from Trunk to Branch.

Configure Git Source Control Provider For Development Team

I'm totaly newbie to Source Control idea, so please be kind.
My situation is that we are a development team which contains 2 developers and 1 designer.
We use Visual Studio 2010 and we need to use a Git as a Source Control.
I've installed Git Source Control Provider and GitExtensions using Extensions Manager on all machines.
But there is only one thing I don't get it, how can I configure every Git on every machine to find a central repositry where we can Push and Update all work in one place?
Does that mean everyone will take a copy of a solution into his own machine (Locally) and configure Git to a repositry OR are we going to run on the same solution?
Honestly, I have not found articles regarding this issue and how teams on same project on Visual Studio 2010?
Git is distributed version control system means that whenever you clone a repository you can work on your copy and commit too. Once you done you can push the commits to remote repository.

TFS: submit changes done locally in one branch to another branch

I made changes to a lot of files, and in the meantime I figured I rather commit this untested code to a yet-to-be-created branch, so that users of the existing code base are not affected.
As I touched really many, many files and created and added new sub-projects etc., I want to avoid copying files and folders manually.
What's the easiest way to get this done in Visual Studio?
This functionality is provided using tfpt unshelve /migrate. To use it, follow these steps:
Create a shelveset of your changes (from the UI, or tf shelve . /R)
Create the new branch
Download and install the Team Foundation Server Power Tools
From a Visual Studio Command Prompt, run the following command: tfpt unshelve /migrate /source:$/TeamProject/Main /target:$/TeamProject/Beta
This will essentially re-write the paths in your shelveset to the new branch.

Is there a way in VS 2010 with TFS 2008 to check in your changes as a new branch?

My question is rather simple I have made many changes in our project which I don't want to merge with the main branch right away. I did not take a branch at the start of these changes while I was making them. So now I tried to find a way to take branch to check in my code but there does not seem to be a solution. How can I do this and what is the best approach to take. I am using Visual Studio 2010 which connects to TFS 2008.
Thanks a lot.
You could create a new branch now and then change the paths on your edited files to the new branch before checking them in.
Create a new branch.
Shelve your pending changes.
Use the power tools to move the shelved changes from the current branch to your new branch using the following command.
tfpt unshelve [MY_SHELVESET_NAME] /migrate /source:CURRENT_BRANCH_PATH /target:NEW_BRANCH_PATH
Take a look at the powertools help to get further details.

Resources