I checked out some files from the main branch of our code set in TFS. Later, a separate branch was created. I would like to check in my code to the new branch, even though I originally checked it out of the original one. Is this possible?
EDIT: I know I can check in to the main branch and do a merge, but I'd like to avoid that if possible.
To switch to a new branch, a database must be unlinked from source control (unlinked from the current branch), and re-linked to a new project (folder) that represents a newly created branch.
Access the "Source Control" tab on the left side of VSCode. Click on the "three small dots" next to the refresh button. Click on the "Checkout to..." option. Choose the branch you want to switch to.
With TFS, there are several ways that you can handle releases. You can tag/label each release branch or bug fix. But the relationship between release branches and the release is not always clear. Teams need to create a naming scheme and define a TFS branching strategy to help document the flow of change.
In Source Control Explorer, right-click the folder or file that you want to branch, point to Branching and Merging, and then click Branch.
I couldn't do with the answers using Power Tools, so I checked in on the source branch, merged to target, and rolled back from source branch.
Well, it's based on which version control you are using.
If you are using GIT, it's simple. After you created the new branch in the UI, you just need to do a 'check out' of the new branch. Any uncommitted changes will be automatically point to the new branch. You can then commit them there.
If you are using TFVC, you need to shelve your changes on the original branch and unshelve them on the other branch. This functionality is provided using tfpt unshelve /migrate
command. More detail steps please refer the question: TFS: submit changes done locally in one branch to another branch
It's also a sample which shows the difference between GIT and TFVC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With