Migrate Version Control System to .git
Almost all source code contains some format of delicate information, whether it be configuration-related information such as database credentials or information on how the web application functions, such as a web template.
If such information is disclosed, this information potentially could be used by an attacker to discover logical flaws and escalate into a successive chain of attacks. These include attacks such as SQL injection, database takeovers, cross-site scripting, remote code execution, and sometimes distributed denial of service.
To achieve a solution for conducting a risk-free and systemic migration, we need to plan three stages for the code migration process: pre-migration, migration, and post-migration.
Migrating to Git
Before we get to how to migrate, we have to address the issue of history. When teams migrate source control systems, they always ask about history. I push back a bit and inform teams that their old source control system isn’t going away, so you don’t lose history. For a small period of time, you may have two places to check for history — but most teams don’t check history further out than the last month regularly. Some teams may have compliance or regulatory burdens, but these are generally the exception. Don’t let the fear of “losing history” prevent you from modernizing your source control!
Migrating
So how can you migrate to Git? There are at least three ways:
- Tip migration
- Azure DevOps single branch import
- TFS-Git
To Migrate your repository from Microsoft TFS To Any Source Control.
We need to ensure get all the repository activity like ( Branches, Commit History, Issues, and Pusher as well)
TFS-Git-Migration
What if you need to migrate more than a single branch and retain branch relationships? Or you’re going to ignore my advice and insist on dragging all your history with you? In that case, you’re going to have to use Git-tfs. This is an open-source project that is build to synchronize Git and TFVC repos. But you can use it to do a once-off migration using
- Frist Download Microsoft Git-TFS
- Extract this folder, and coped that software to your machine, and make sure you have JAVA run time.
- Now open CMD or GITBACH and we need to navigate to an actual directory,
- Another step, Create a folder to store the repo inside.
- Finally, RUN this Command line
git-tf clone https://tfs.{DomainName}.com.sa/tfs/defaultcollection/ $/MigrationTest D:\{FolderName}\git-tf-2.0.3.20131219\TestMigration — deep
- Now you got the completed repository.
You have many ways to push this repo to any version control.
- bush to GitHub Create repository there
- Clone your repo and paste the folder inside
- Write git status in CITBACH
- Write git Add .
- Write git commit -m “your message”
- Write git Bush
Also, you can push this repo to any source control.
You can Import your project from GitHub to GitLab
Using the importer, you can import your GitHub repositories to GitLab.com or to your self-managed GitLab instance.
This feature is a collaboration between GitLab and GitHub.
All the best. By Mohsen.