Reputation: 95
I have a project, Let's say Project - A and a repo inside it as RA. I need to move a folder from RA to another folder in another Repo RBof Project -** B**. The problem is I want to retain the history of all the commits while doing that. Can anyone guide me through to get this done?
Upvotes: 7
Views: 16978
Reputation: 19461
For Git, just using the Import Repository feature, you can import a Git repository to your team project from other project's git repo. The newly imported repo will keep all commit history. For details,please refer to this document.
For TFVC, you need to use 3rd tool, you can try it with OpsHub Visual Studio Online Migration Utility. You could also decide to move to Git as part of your migration. Use git-tfs to create a local git repository with all your TFVC history and then push that into a bare Git repository in your new team project. Or use the TFVC import tool. You can refer to this case for details.
Update: You can download the folder as Zip,Then upload the unzip files to the folder of another project's repo .
Upvotes: 7
Reputation: 1625
1.Download the code from Source repo:
git clone $sourceRepoURL $sourceRepoFolder --single-branch --branch master
2.Create master branch in Target repo - either using Portal or Git
3.Upload the code to Target repo:
git remote add --mirror=fetch target $targetRepoURL
git push target --all
Upvotes: 1