ТЕМА: San Jose : python azure devops - Eduard Kabrinskiy

San Jose : python azure devops - Eduard Kabrinskiy 2 years 10 months ago #30342

Kabrinskiy Eduard - Azure devops git repository - Eduard Kabrinskiy


<h1>Azure devops git repository</h1>
<p>[youtube]</p>
Azure devops git repository <a href="remmont.com">Breaking news today</a> Azure devops git repository
<h1>Azure devops git repository</h1>
<p>Azure DevOps supports two types of version control, Git and Team Foundation Version Control (TFVC). Here is a quick overview of the two version control systems:</p>
<p><strong>Team Foundation Version Control (TFVC)</strong>: TFVC is a centralized version control system. Typically, team members have only one version of each file on their dev machines. Historical data is maintained only on the server. Branches are path-based and created on the server.</p>
<p><strong>Git</strong>: Git is a distributed version control system. Git repositories can live locally (such as on a developer’s machine). Each developer has a copy of the source repository on their dev machine. Developers can commit each set of changes on their dev machine and perform version control operations such as history and compare without a network connection.</p>
<p>Git is the default version control provider for new projects. You should use Git for version control in your projects unless you have a specific need for centralized version control features in TFVC.</p>
<p>In this lab, you will learn how to establish a local Git repository, which can easily be synchronized with a centralized Git repository in Azure DevOps. In addition, you will learn about Git branching and merging support. You will use Visual Studio Code, but the same processes apply for using any Git-compatible client with Azure DevOps.</p>
<h3>Prerequisites</h3>
<p>Visual Studio Code with the C# extension installed.</p>
<p>This lab requires you to complete task 1 from the prerequisite instructions (Skip cloning, it is done in the exercise).</p>
<h2>Exercise 1: Configuring the lab environment</h2>
<h3>Task 1: Configuring Visual Studio Code</h3>
<p>Open <strong>Visual Studio Code</strong>. In this task, you will configure a Git credential helper to securely store the Git credentials used to communicate with Azure DevOps. If you have already configured a credential helper and Git identity, you can skip to the next task.</p>
<p>From the main menu, select <strong>Terminal | New Terminal</strong> to open a terminal window.</p>
<p>Execute the command below to configure a credential helper.</p>
<p>The commands below will configure your user name and email for Git commits. Replace the parameters with your preferred user name and email and execute them.</p>
<h2>Exercise 2: Cloning an existing repository</h2>
<h3>Task 1: Cloning an existing repository</h3>
<p>In a browser tab, navigate to your team project on Azure DevOps.</p>
<p>Getting a local copy of a Git repo is called “cloning”. Every mainstream development tool supports this and will be able to connect to Azure Repos to pull down the latest source to work with. Navigate to the <strong>Repos</strong> hub.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/000.png" /></p>
<p>Click <strong>Clone</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/001.png" /></p>
<p>Click the <strong>Copy to clipboard</strong> button next to the repo clone URL. You can plug this URL into any Git-compatible tool to get a copy of the codebase.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/002.png" /></p>
<p>Open an instance of <strong>Visual Studio Code</strong>.</p>
<p>Press <strong>Ctrl+Shift+P</strong> to show the <strong>Command Palette</strong>. The Command Palette provides an easy and convenient way to access a wide variety of tasks, including those provided by 3rd party extensions.</p>
<p>Execute the <strong>Git: Clone</strong> command. It may help to type <strong>“Git”</strong> to bring it to the shortlist.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/003.png" /></p>
<p>Paste in the URL to your repo and press <strong>Enter</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/004.png" /></p>
<p>Select a local path to clone the repo to.</p>
<p>When prompted, log in to your Azure DevOps account.</p>
<p>Once the cloning has completed, click <strong>Open</strong> to open the cloned repository. You can ignore any warnings raised about opening the projects. The solution may not be in a buildable state, but that’s okay since we’re going to focus on working with Git and building the project itself is not necessary.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/005_new.png" /></p>
<h2>Exercise 3: Saving work with commits</h2>
<p>When you make changes to your files, Git will record the changes in the local repository. You can select the changes that you want to commit by staging the changes. Commits are always made against your local Git repository, so you don’t have to worry about the commit being perfect or ready to share with others. You can make more commits as you continue to work and push the changes to others when they are ready to be shared.</p>
<p>What’s in a commit?</p>
<p>Git commits consists of the following:</p>
<p>The file(s) changed in the commit. Git keeps the contents of all file changes in your repo in the commits. This keeps it fast and allows intelligent merging.</p>
<p>A reference to the parent commit(s). Git manages your code history using these references.</p>
<p>A message describing a commit. You give this message to Git when you create the commit. It’s a good idea to keep this message descriptive, but to the point.</p>
<h3>Task 1: Committing changes</h3>
<p>From the <strong>Explorer</strong> tab, open <strong>/PartsUnlimited-aspnet45/src/PartsUnlimitedWebsite/Models/CartItem.cs</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/012.png" /></p>
<p>Add a comment to the file. It doesn’t really matter what the comment is since the goal is just to make a change. Press <strong>Ctrl+S</strong> to save the file.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/013.png" /></p>
<p>Select the <strong>Source Control</strong> tab to see the one change to the solution.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/014.png" /></p>
<p>Enter a commit message of <strong>“My commit”</strong> and press <strong>Ctrl+Enter</strong> to commit it locally.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/015.png" /></p>
<p>If asked whether you would like to automatically stage your changes and commit them directly, click <strong>Always</strong>. We will discuss <strong>staging</strong> later in the lab.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/016.png" /></p>
<p>Click the <strong>Synchronize Changes</strong> button to synchronize your changes with the server. Confirm the sync if prompted.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/017.png" /></p>
<h3>Task 2: Reviewing commits</h3>
<p>Switch to the Azure DevOps browser tab. You can review the latest commits on Azure DevOps under the <strong>Commits</strong> tab of the <strong>Repos</strong> hub.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/018.png" /></p>
<p>The recent commit should be right at the top.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/019.png" /></p>
<h3>Task 3: Staging changes</h3>
<p>Staging changes allows you to selectively add certain files to a commit while passing over the changes made in other files.</p>
<p>Return to <strong>Visual Studio Code</strong>.</p>
<p>Update the open <strong>CartItem.cs</strong> class by editing the comment you made earlier and saving the file.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/020.png" /></p>
<p>Open <strong>Category.cs</strong> as well.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/021.png" /></p>
<p>Add a new comment to <strong>Category.cs</strong> so there will be two files with changes. Save the file.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/022.png" /></p>
<p>From the <strong>Source Control</strong> tab, click the <strong>Stage Changes</strong> button for <strong>CartItem.cs</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/023.png" /></p>
<p>This will prepare <strong>CartItem.cs</strong> for committing without <strong>Category.cs</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/024.png" /></p>
<p>Enter a comment of <strong>“Added comments”</strong>. From the <strong>More Actions</strong> dropdown, select <strong>Commit Staged</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/025_new.png" /></p>
<p>Click the <strong>Synchronize Changes</strong> button to synchronize the committed changes with the server. Note that since only the staged changes were committed, the other changes are still pending locally.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/026.png" /></p>
<h2>Exercise 4: Reviewing history</h2>
<p>Git uses the parent reference information stored in each commit to manage a full history of your development. You can easily review this commit history to find out when file changes were made and determine differences between versions of your code using the terminal or from one of the many Visual Studio Code extensions available. You can also review changes using the Azure DevOps portal.</p>
<p>Git’s use of the <strong>Branches and Merges</strong> feature works through pull requests, so the commit history of your development doesn’t necessarily form a straight, chronological line. When you use history to compare versions, think in terms of file changes between two commits instead of file changes between two points in time. A recent change to a file in the master branch may have come from a commit created two weeks ago in a feature branch but was only merged yesterday.</p>
<h3>Task 1: Comparing files</h3>
<p>In the <strong>Source Control</strong> tab, select <strong>Category.cs</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/027.png" /></p>
<p>A comparison view is opened to enable you to easily locate the changes you’ve made. In this case, it’s just the one comment.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/028.png" /></p>
<p>Go to the <strong>Commits</strong> view in <strong>Azure DevOps</strong> to locate some of the source branches and merges. These provide a convenient way to visualize when and how changes were made to the source.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/031.png" /></p>
<p>From the dropdown for <strong>Merged PR 27</strong>, select <strong>Browse Files</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/032_new.png" /></p>
<p>This view offers the ability to navigate around the state of the source at that commit so you can review and download those files.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/033_new.png" /></p>
<h2>Exercise 5: Working with branches</h2>
<p>You can manage the work in your Azure DevOps Git repo from the <strong>Branches</strong> view on the web. You can also customize the view to track the branches you care most about so you can stay on top of changes made by your team.</p>
<p>Committing changes to a branch will not affect other branches and you can share branches with others without having to merge the changes into the main project. You can also create new branches to isolate changes for a feature or a bug fix from your master branch and other work. Since the branches are lightweight, switching between branches is quick and easy. Git does not create multiple copies of your source when working with branches, but rather uses the history information stored in commits to recreate the files on a branch when you start working on it. Your Git workflow should create and use branches for managing features and bugfixes. The rest of the Git workflow, such as sharing code and reviewing code with pull requests, all work through branches. Isolating work in branches makes it very simple to change what you are working on by simply changing your current branch.</p>
<h3>Task 1: Creating a new branch in your local repository</h3>
<p>Return to <strong>Visual Studio Code</strong>.</p>
<p>Click the <strong>master</strong> branch from the bottom left.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/034.png" /></p>
<p>Select <strong>Create new branch from…</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/035.png" /></p>
<p>Enter the name <strong>“dev”</strong> for the new branch and press <strong>Enter</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/036.png" /></p>
<p>Select the <strong>master</strong> as the reference branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/037.png" /></p>
<p>You are now working on that branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/038.png" /></p>
<h3>Task 2: Working with branches</h3>
<p>Git keeps track of which branch you are working on and makes sure that when you checkout a branch your files match the most recent commit on the branch. Branches let you work with multiple versions of the source code in the same local Git repository at the same time. You can use Visual Studio Code to publish, check out and delete branches.</p>
<p>Click the <strong>Publish changes</strong> button next to the branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/039.png" /></p>
<p>From the Azure DevOps browser tab, select <strong>Branches</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/040.png" /></p>
<p>You should see the newly pushed <strong>dev</strong> branch. Click on more actions drop down and Select the <strong>Delete branch</strong> button to delete it. Confirm the delete.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/041_new.png" /></p>
<p>Return to <strong>Visual Studio Code</strong>.</p>
<p>Click the <strong>dev</strong> branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/042.png" /></p>
<p>Note that there are two <strong>dev</strong> branches listed. The local (<strong>dev</strong>) branch is there because it’s not deleted when the server branch is deleted. The server (<strong>origin/dev</strong>) is there because it hasn’t been pruned. Select the <strong>master</strong> branch to check it out.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/043.png" /></p>
<p>Press <strong>Ctrl+Shift+P</strong> to open the <strong>Command Palette</strong>.</p>
<p>Start typing <strong>“Git: Delete”</strong> and select <strong>Git: Delete Branch</strong> when it becomes visible.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/044.png" /></p>
<p>There is only one local branch to delete, so select it.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/045.png" /></p>
<p>Click the <strong>master</strong> branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/046.png" /></p>
<p>Note that the local <strong>dev</strong> branch is gone, but the remote <strong>origin/dev</strong> is still showing.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/047.png" /></p>
<p>Press <strong>Ctrl+Shift+P</strong> to open the <strong>Command Palette</strong>.</p>
<p>Start typing <strong>“Git: Fetch”</strong> and select <strong>Git: Fetch (Prune)</strong> when it becomes visible. This command will update the origin branches in the local snapshot and delete those that are no longer there.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/048.png" /></p>
<p>You can check in on exactly what these tasks are doing by selecting the <strong>Output</strong> window at the bottom of the screen.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/049.png" /></p>
<p>Note that if you don’t see the Git logs in the output console, you may need to select <strong>Git</strong> as the source.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/050.png" /></p>
<p>Click the <strong>master</strong> branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/051.png" /></p>
<p>The <strong>origin/dev</strong> branch should no longer be in the list.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/052.png" /></p>
<h2>Exercise 6: Managing branches from Azure DevOps</h2>
<p>In addition to all the functionality available in Visual Studio Code, you can also manage your repo branches from the Azure DevOps portal.</p>
<h3>Task 1: Creating a new branch</h3>
<p>Switch to the Azure DevOps browser tab.</p>
<p>Navigate to <strong>Repos | Branches</strong>. Click <strong>New branch</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/053_new.png" /></p>
<p>Enter a name of <strong>“release”</strong> for the new branch. Use the <strong>Work items to link</strong> dropdown to select one or more work items to link to this new branch. Click <strong>Create branch</strong> to create it.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/054_new.png" /></p>
<p>After the branch has been created, it will be available in the list.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/055.png" /></p>
<p>Return to <strong>Visual Studio Code</strong>.</p>
<p>Press <strong>Ctrl+Shift+P</strong> to open the <strong>Command Palette</strong>.</p>
<p>Start typing <strong>“Git: Fetch”</strong> and select <strong>Git: Fetch</strong> when it becomes visible. This command will update the origin branches in the local snapshot.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/056.png" /></p>
<p>Click the <strong>master</strong> branch.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/057.png" /></p>
<p>Select <strong>origin/release</strong>. This will create a new local branch called <strong>“release”</strong> and check it out.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/058.png" /></p>
<h3>Task 2: Deleting a branch</h3>
<p>Return to Azure DevOps and click the <strong>Delete branch</strong> from the more actions drop down to delete it.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/059_new.png" /></p>
<p>You can <strong>Restore branch</strong> if you want by searching for an exact branch name. Select <strong>Restore branch</strong> as shown below.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/060_new.png" /></p>
<h3>Task 3: Locking a branch</h3>
<p>Locking is ideal for preventing new changes that might conflict with an important merge or to place a branch into a read-only state. Alternatively, you can use branch policies and pull requests instead of locking if you just want to ensure that changes in a branch are reviewed before they are merged.</p>
<p>Locking does not prevent cloning of a repo or fetching updates made in the branch into your local repo. If you lock a branch, share with your team the reason why and make sure they know what to do to work with the branch after it is unlocked.</p>
<p>From the <strong>master</strong> context menu, select <strong>Lock</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/061.png" /></p>
<p>The branch is now locked.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/062.png" /></p>
<p>Now <strong>Unlock</strong> the branch using the same process.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/063.png" /></p>
<h3>Task 4: Tagging a release</h3>
<p>While it may not seem like much, the product team has decided that this version of the site is exactly what’s needed for v1.1. In order to mark it as such, navigate to the <strong>Tags</strong> tab.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/064.png" /></p>
<p>Click <strong>Create Tag</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/065.png" /></p>
<p>Enter a <strong>name</strong> of <strong>“v1.1”</strong> and a <strong>Description</strong> of <strong>“Great release!”</strong>. Click <strong>Create</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/066.png" /></p>
<p>You have now tagged the project at this release. You could tag commits for a variety of reasons and Azure DevOps offers the flexibility to edit and delete them, as well as manage their permissions.</p>
<p style="clear: both">## <img style="float: left; margin: 0 10px 5px 0;" src="azuredevopslabs.com/labs/azuredevops/git/images/067.png" />##</p>
<h2>Exercise 7: Managing repositories</h2>
<p>You can create Git repos in team projects to manage your project’s source code. Each Git repo has its own set of permissions and branches to isolate itself from other work in your project.</p>
<h3>Task 1: Creating a new repo from Azure DevOps</h3>
<p>From the project <strong>Add</strong> dropdown, select <strong>New repository</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/068.png" /></p>
<p>Set the <strong>Repository name</strong> to <strong>“New Repo”</strong>. Note that you also have the option to create a file named <strong>README.md</strong>. This would be the default markdown file that is rendered when someone navigates to the repo root in a browser. Additionally, you can preconfigure the repo with a <strong>.gitignore</strong> file. This file specifies which files, based on naming pattern and/or path, to ignore from source control. There are multiple templates available that include the common patterns and paths to ignore based on the project type you are creating. Click <strong>Create</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/069.png" /></p>
<p>That’s it. Your repo is ready. You can now clone it with Visual Studio or your tools of choice.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/070.png" /></p>
<h3>Task 2: Deleting and renaming Git repos</h3>
<p>Sometimes you’ll have a need to rename or delete a repo, which is just as easy. Open <strong>Project settings</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/ps.png" /></p>
<p>Select <strong>Repositories</strong> under <strong>Repos</strong>.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git...s/settings-repos.png" /></p>
<p>From the <strong>New Repo</strong> context menu, select <strong>Delete repository</strong>. Alternatively, you could rename it here.</p>
<p style="clear: both"><img src="azuredevopslabs.com/labs/azuredevops/git/images/repo-delete.png" /></p>
<p>Enter the name <strong>“New Repo”</strong> to confirm the repo and click <strong>Delete</strong>.</p>
<h2>Azure devops git repository</h2>

<h3>Azure devops git repository</h3>
<p>[youtube]</p>
Azure devops git repository <a href="remmont.com">Current news in english</a> Azure devops git repository
<h4>Azure devops git repository</h4>
Azure devops git repository Azure DevOps supports two types of version control, Git and Team Foundation Version Control (TFVC). Here is a quick overview of the two version control systems:
<h5>Azure devops git repository</h5>
Azure devops git repository <a href="remmont.com">Azure devops git repository</a> Azure devops git repository
SOURCE: <h6>Azure devops git repository</h6> <a href="dev-ops.engineer/">Azure devops git repository</a> Azure devops git repository
#tags#[replace: -,-Azure devops git repository] Azure devops git repository#tags#

Эдуард Кабринский
online news
  • ARIZONA-Dal
  • ARIZONA-Dal's Avatar
  • Вне сайта
  • Платиновий учасник
  • Сообщений: 1257
  • Репутация: 0
Администратор запретил публиковать записи гостям.
Время создания страницы: 0.057 секунд