2/2/2024 0 Comments Subversion best practiceAs shown in the image below, the same structure that exists in the trunk project is copied to the Feature1 folder, under the Branches folder: Let’s explore the repository directly, to check the newly created branch. When the process is finished, a validation message appears: Once we have everything set, clicking the OK button will create the specified branch. We’ll specify Feature1 as a name of a new branch. Since we have a separate folder inside the repository that will hold only branches, let’s use the Browse button to navigate to the Branches folder: By default, a name of a new branch is a combination of the source branch followed by the word “branch”. The Target field is where we need to specify a new branch. We’ll select the middle changeset that represents the initial commit without any additional changes: That means changes from changesets committed after the selected changeset will not be included in a new branch.įor instance, let’s assume that we do not need the most recent change, where the Test column is added to the Address table, in a new branch. The middle one, “SQLTech”, represents the initial commit and the one on top, “SQLTech”, represents the most recent change that is committed, related to the Address table.īy selecting any of the changesets from the list, changes committed in the selected changeset along with changes committed in any previous changeset will be included. The bottom one, “VisualSVN Server” is a generic changeset, created by VisualSVN application when the repository is initiated. This cannot be changed since the currently active project is pre-defined as a source branch:īelow the Source field is a list of changesets committed to the trunk branch. As shown in the image below, the Source filed contains the current active project which is the trunk project. In order to create a new branch, right click a database and choose the Create branch option from the More source control option context menu: Instead, let’s create a new branch where all additional changes will be committed. The following script is used to make a change:Īssuming that after committing a change related to the Address table a database reached a point where it can be promoted to other environments, we do not want to break this by commit each and every new change to the trunk project. We’ll made additional change that will be committed to the trunk project before creating a new branch. In order to do so, the trunk folder will be set as a project in the last step of the Source control wizard:Īfter a database is linked, let’s initially commit all objects to the previously selected trunk project: We’ll link a database to a Subversion repository, specifically to the trunk folder. It is important to mention that for the purpose of this article, we’ll use a Subversion repository that has the following structure: To find out how to link a database to a Subversion repository, check the article: How to link a SQL Server database to a Subversion repository. We’ll use a Subversion repository hosted locally by Visual SVN Server but all the entire workflow goes the same way regardless of the used Subversion repository. In order to make a new branch active and to be able to commit changes, a database must be re-linked.Īs the final part, we’ll merge changes committed to a new branch with the main branch. Next, we’ll create a new branch from trunk. The branches folder will keep all the branches created along the way while the tags folder contains all tags aka labels created. The trunk folder is a main line that should contain only tested changes that are ready to be promoted to other environments. The default folder structure in Subversion means a single-project repository exists with top level folders: trunk, branches and tags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |