ТЕМА: Syracuse : epam devops - Эдуард Кабринский

Syracuse : epam devops - Эдуард Кабринский 2 років 10 місяців тому #30215

Эдуард Кабринский - Svn devops - Kabrinskiy Eduard


<h1>Svn devops</h1>
<p>[youtube]</p>
Svn devops <a href="remmont.com">Current news</a> Svn devops
<h1>Learn how to migrate from Subversion (SVN) to Git, including history</h1>
<p>When moving to Git from another version control system like Subversion (SVN), we generally recommend that you perform a "tip migration", which migrates just the latest version of the repository contents, without including history. However, many people want to perform a more advanced migration, including history. This guidance will introduce a migration <em>with</em> history.</p>
<p>SVN migrations to Git can vary in complexity, depending on how old the repository is and how many branches were created and merged, and whether you're using regular SVN or close relative like SVK.</p>
<p>It could be simple if:</p>
<p><ul>
<li>You have a new repository</li>
<li>You have a standard setup of a trunk, branches, and tags directory</li>
</ul>
</p>
<p>It's likely going to be complex if:</p>
<p><ul>
<li>Your team has performed many branching and merging operations</li>
<li>Your repository follows a non-standard directory setup</li>
<li>Your directory setup has changed over time</li>
</ul>
</p>
<p>There are several ways to migrate from SVN to Git. The approach outlined in this article is based on using git-svn, a Git extension, which can be used to check out a Subversion repository to a local Git repository and then push changes from the local Git repository back to the Subversion repository. These steps give a detailed overview of the process for migrating from SVN to Git in a Windows environment, without synchronizing back to the original SVN repository. The result will be a bare Git repository for sharing with the rest of your team.</p>
<p>Before you try to migrate your source code from a centralized version control system to Git, be sure that you familiarize yourself with the differences between centralized and distributed version control systems, and plan your team's migration. After you've prepared, you can begin the migration.</p>
<p>The high-level workflow for migrating from SVN to Git is as follows:</p>
<p><ul>
<li>Prepare a migration environment</li>
<li>Convert the source SVN repository to a local Git repository</li>
<li>(Optional) Synchronize the local Git repository with any changes from SVN repository while developers continue using SVN</li>
<li>Push the local Git repository to a remote Git repository hosted on Azure Repos</li>
<li>Lock SVN repository, synchronize any remaining changes from SVN repository to local Git repository and push final changes to the remote Git repository on Azure Repos</li>
<li>Developers switch to Git as main source control system</li>
</ul>
</p>
<h2>Prepare a migration environment</h2>
<p>Configure a migration environment on a local workstation and install the following software:</p>
<p>You will also need to create a Git repository for your organization to host the converted SVN repository, you may follow Create a new Git repo in your project </p>
<h2>Convert the source SVN repository to a local Git repository</h2>
<p>The goal of this step is to convert the source Subversion repository to a local <em>bare</em> Git repository. A <em>bare</em> Git repository does not have a local working checkout of files that can be changed, instead it only contains the repository's history and the metadata about the repository itself. This is the recommended format for sharing a Git repository via a remote repository hosted on a service like Azure Repos.</p>
<p><em>Bare</em> Git repositories are structured differently and given the fact that it doesn't have a working directory prevent direct commit to the repository.</p>
<p style="clear: both"><img src="docs.microsoft.com/en-us/azure/devops/re...it/bare-git-repo.png" /></p>
<h3>Retrieve a list of all Subversion authors</h3>
<p>Subversion just uses the username for each commit, while Git stores both a real name and an email address. By default, the git-svn tool will list the SVN username in the author and email fields. However, you can create a mapping file for SVN users along with their corresponding Git names and emails.</p>
<p><strong>Subversion users</strong></p>
<p style="clear: both"><img src="docs.microsoft.com/en-us/azure/devops/re...n-to-git/svn-log.png" /></p>
<p><strong>Git users</strong></p>
<p style="clear: both"><img src="docs.microsoft.com/en-us/azure/devops/re...n-to-git/git-log.png" /></p>
<p>To extract a list of all SVN users from the root of your local Subversion checkout, run this PowerShell command:</p>
<p>This command will retrieve all the log messages, extract the usernames, eliminate any duplicate usernames, sort the usernames, and place them into a "authors-transform.txt" file. You can then edit each line in the file to create a mapping of SVN users to a well-formatted Git user. For example, you can map jamal = jamal to jamal = Jamal Hartnett .</p>
<p>Encoding can be adjusted by appending the <strong>-Encoding</strong> option to the command above, for instance, OutFile 'authors-transform.txt' -Encoding utf8 .</p>
<h3>Clone the Subversion repository using git-svn</h3>
<p>The following command will do the standard git-svn transformation using the authors-transform.txt file created in the earlier step. It will place the Git repository in the c:\mytempdir folder in your local machine.</p>
<p>The --prefix=svn/ is necessary because otherwise the tools can't tell SVN revisions from imported ones. We recommend setting a prefix (with a trailing slash), as your SVN-tracking refs will then be located at refs/remotes/$prefix/ , which is compatible with Git's own remote-tracking branch layout ( refs/remotes/$remote/ ).</p>
<p>Setting a prefix is also useful if you wish to track multiple projects that share a common repository. By default, the prefix is set to origin/ .</p>
<p>If you are using the standard trunk, branches, tags layout you'll just put --stdlayout . However, if you have something different you may have to pass the --trunk , --branches , and --tags to find what is what. For example, if your repository structure was trunk/companydir and you branched that instead of trunk, you would probably want --trunk=trunk/companydir --branches=branches .</p>
<p>This command can take a few minutes to several hours depending on the size of the SVN repository. Upon completion, you will have a Git checkout of your repository.</p>
<h3>Convert version control-specific configurations</h3>
<p>If your SVN repo was using svn:ignore properties, you can convert to a <strong>.gitignore</strong> file using:</p>
<p>Read more about <strong>.gitignore</strong>: Ignore file changes with Git</p>
<h3>Push repository to a bare git repository</h3>
<p>In this step, you will create a bare repository and make its default branch match SVN's trunk branch name.</p>
<p>Create a bare Git repository</p>
<p>Push the local Git repository to the new bare Git repository</p>
<p>Rename "trunk" branch to "master" Your main development branch will be named "trunk", which matches the name it was in Subversion. You'll want to rename it to Git's standard "master" branch using:</p>
<p>Clean up branches and tags git-svn makes all of Subversions tags into very-short branches in Git of the form "tags/name". You'll want to convert all those branches into actual Git tags or delete them.</p>
<h3>Migrate SVN tags to be Git tags</h3>
<h2>Advanced migrations</h2>
<h3>Create all the SVN branches as proper Git branches</h3>
<p>While it's easy to create all SVN branches as a proper Git branches, it's recommended that you evaluate the following points before you continue:</p>
<p>If there are Feature branches: Can you wait until they integrate to the trunk before migrating?</p>
<p>If there are Release branches: Does it make sense to keep SVN around for servicing? If you migrate feature branches, are you prepared to service branches out of Git?</p>
<p>If you still want to migrate existing branches, run the following PowerShell command:</p>
<p>This command can take a few minutes to several hours depending on the size of the SVN repository. Upon completion, you will have a Git checkout of your repository.</p>
<h2>Update your workflow</h2>
<p>Moving from a centralized version control system to Git is more than just migrating code. Your team needs training to understand how Git is different from your existing version control system and how these differences affect day-to-day work. Learn more.</p>
<h2>Reference information</h2>
<blockquote><p>Authors: Hosam Kamel, William H. Salazar | Find the origin of this article and connect with the ALM | DevOps Rangers here</p></blockquote>
<p><em>(c) 2017 Microsoft Corporation. All rights reserved. This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it.</em></p>
<p><em>This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes.</em></p>
<h2>Svn devops</h2>

<h3>Svn devops</h3>
<p>[youtube]</p>
Svn devops <a href="remmont.com">To day news</a> Svn devops
<h4>Svn devops</h4>
Learn how to migrate from Subversion (SVN) to Git, including history
<h5>Svn devops</h5>
Svn devops <a href="remmont.com">Svn devops</a> Svn devops
SOURCE: <h6>Svn devops</h6> <a href="dev-ops.engineer/">Svn devops</a> Svn devops
#tags#[replace: -,-Svn devops] Svn devops#tags#

Eduard Kabrinskiy
headline news
  • NEF6gole
  • NEF6gole аватар
  • Немає на сайті
  • Елітний учасник
  • Дописи: 276
  • Репутація: 0
Адміністратор заборонив доступ на запис.
Час відкриття сторінки: 0.074 секунд