|
1 |
| ---- |
2 |
| -title: '1. Set up a GitHub repository' |
3 |
| -layout: default |
4 |
| -nav_order: 1 |
5 |
| -parent: 'Exercise 02: Start working in GitHub' |
6 |
| ---- |
7 |
| - |
8 |
| -# Task 01 - Set up a GitHub repository (10 minutes) |
9 |
| - |
10 |
| -## Introduction |
11 |
| - |
12 |
| -Version control is typically one of the first components that teams implement as they start on projects. Version control is also one of the oldest and most well understood components of DevOps. Version control systems allow developers to collaborate and simultaneously contribute to the same codebase. They can also help teams track versions--so code can be rolled back if bad changes are made--as well as bugs, work items, and test results. If necessary, please take a moment to review the [Git handbook](https://guides.github.com/introduction/git-handbook/) to understand the basics of version control, focusing on the distributed version control technology Git. |
13 |
| - |
14 |
| -## Description |
15 |
| - |
16 |
| -In this task, you will ensure that you have a GitHub repository set up with the Munson's Pickles and Preserves Team Messaging System application code in it. The MP&P development team has provided us a simple version of an internal messaging system they use. This .NET 6 application is the one they would like to use for a DevOps proof of concept. They have also provided a Bicep template for creating Azure resources. |
17 |
| - |
18 |
| -The key tasks are as follows: |
19 |
| - |
20 |
| -1. Fork [the starter GitHub repository](https://github.com/microsoft/TechExcel-Accelerate-developer-productivity-with-GitHub-Copilot-and-Dev-Box) to your GitHub account. |
21 |
| -2. Clone your new repository to your machine. |
22 |
| - |
23 |
| -## Success Criteria |
24 |
| - |
25 |
| -- You have a repository cloned to your local machine and synchronized with GitHub.com. |
26 |
| -- You are able to see `Application` and `InfrastructureAsCode` folders inside the `src` folder at the root of your repository. |
27 |
| - |
28 |
| -## Learning Resources |
29 |
| - |
30 |
| -- [Forking a GitHub repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) |
31 |
| -- Cloning a repository via the [command line](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) or [GitHub Desktop](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-a-repository-from-github-to-github-desktop) |
32 |
| - - For those using GitHub Desktop, here is documentation on [committing](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/committing-and-reviewing-changes-to-your-project) and [pushing](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/pushing-changes-to-github) changes to a repository. |
33 |
| - - If working with the command line, check out these articles on [committing](https://docs.github.com/en/github/committing-changes-to-your-project/creating-and-editing-commits) and [pushing](https://docs.github.com/en/github/using-git/pushing-commits-to-a-remote-repository) changes. |
34 |
| -- Additionally, you may need to pull other people's changes into your local repository to stay in sync--see documentation for [command line](https://docs.github.com/en/github/using-git/getting-changes-from-a-remote-repository) and [GitHub Desktop](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/keeping-your-local-repository-in-sync-with-github). |
35 |
| - |
36 |
| -## Tips |
37 |
| - |
38 |
| -- For a concise explanation of adding files to a repository via the command line, see [here](https://docs.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line). |
39 |
| -- To see how it's done in the GitHub portal, check [here](https://docs.github.com/en/github/managing-files-in-a-repository/managing-files-on-github). |
40 |
| - |
41 |
| -## Solution |
42 |
| - |
43 |
| -<details markdown="block"> |
44 |
| -<summary>Expand this section to view the solution</summary> |
45 |
| - |
46 |
| -- To fork a repository, perform the following steps: |
47 |
| - - Navigate to the repository URL in your browser and then select the "Fork" button. You must be logged into GitHub on your device before forking the repository. |
48 |
| - |
49 |
| -  |
50 |
| - |
51 |
| - - Select your account as the owner and keep the repository name the same. Then, choose **Create fork** to complete the process. |
52 |
| - |
53 |
| -  |
54 |
| - |
55 |
| -- To clone a repository via command line, run `git clone $URL` in the directory into which you wish to copy the repository. In order to get the value for URL, perform the following steps: |
56 |
| - - Navigate to your repository in GitHub. |
57 |
| - - Select the green button labeled "<> Code". |
58 |
| - - In the Clone section of the Local tab, select the copy button to get the URL. |
59 |
| - |
60 |
| -</details> |
| 1 | +--- |
| 2 | +title: '1. Set up a GitHub repository' |
| 3 | +layout: default |
| 4 | +nav_order: 1 |
| 5 | +parent: 'Exercise 02: Start working in GitHub' |
| 6 | +--- |
| 7 | + |
| 8 | +# Task 01 - Set up a GitHub repository (10 minutes) |
| 9 | + |
| 10 | +## Introduction |
| 11 | + |
| 12 | +Version control is typically one of the first components that teams implement as they start on projects. Version control is also one of the oldest and most well understood components of DevOps. Version control systems allow developers to collaborate and simultaneously contribute to the same codebase. They can also help teams track versions--so code can be rolled back if bad changes are made--as well as bugs, work items, and test results. If necessary, please take a moment to review the [Git handbook](https://guides.github.com/introduction/git-handbook/) to understand the basics of version control, focusing on the distributed version control technology Git. |
| 13 | + |
| 14 | +## Description |
| 15 | + |
| 16 | +In this task, you will ensure that you have a GitHub repository set up with the Munson's Pickles and Preserves Team Messaging System application code in it. The MP&P development team has provided us a simple version of an internal messaging system they use. This .NET 6 application is the one they would like to use for a DevOps proof of concept. They have also provided a Bicep template for creating Azure resources. |
| 17 | + |
| 18 | +The key tasks are as follows: |
| 19 | + |
| 20 | +1. Fork [the starter GitHub repository](https://github.com/microsoft/TechExcel-Accelerate-developer-productivity-with-GitHub-Copilot-and-Dev-Box) to your GitHub account. |
| 21 | +2. Clone your new repository to your machine. |
| 22 | +3. Delete the file `.github/workflows/pages.yml`. This is a YAML file that you will not need for this training. Then, commit your changes to the repository. |
| 23 | + |
| 24 | +## Success Criteria |
| 25 | + |
| 26 | +- You have a repository cloned to your local machine and synchronized with GitHub.com. |
| 27 | +- You are able to see `Application` and `InfrastructureAsCode` folders inside the `src` folder at the root of your repository. |
| 28 | + |
| 29 | +## Learning Resources |
| 30 | + |
| 31 | +- [Forking a GitHub repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) |
| 32 | +- Cloning a repository via the [command line](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) or [GitHub Desktop](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-a-repository-from-github-to-github-desktop) |
| 33 | + - For those using GitHub Desktop, here is documentation on [committing](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/committing-and-reviewing-changes-to-your-project) and [pushing](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/pushing-changes-to-github) changes to a repository. |
| 34 | + - If working with the command line, check out these articles on [committing](https://docs.github.com/en/github/committing-changes-to-your-project/creating-and-editing-commits) and [pushing](https://docs.github.com/en/github/using-git/pushing-commits-to-a-remote-repository) changes. |
| 35 | +- Additionally, you may need to pull other people's changes into your local repository to stay in sync--see documentation for [command line](https://docs.github.com/en/github/using-git/getting-changes-from-a-remote-repository) and [GitHub Desktop](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/keeping-your-local-repository-in-sync-with-github). |
| 36 | + |
| 37 | +## Tips |
| 38 | + |
| 39 | +- For a concise explanation of adding files to a repository via the command line, see [here](https://docs.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line). |
| 40 | +- To see how it's done in the GitHub portal, check [here](https://docs.github.com/en/github/managing-files-in-a-repository/managing-files-on-github). |
| 41 | + |
| 42 | +## Solution |
| 43 | + |
| 44 | +<details markdown="block"> |
| 45 | +<summary>Expand this section to view the solution</summary> |
| 46 | + |
| 47 | +- To fork a repository, perform the following steps: |
| 48 | + - Navigate to the repository URL in your browser and then select the "Fork" button. You must be logged into GitHub on your device before forking the repository. |
| 49 | + |
| 50 | +  |
| 51 | + |
| 52 | + - Select your account as the owner and keep the repository name the same. Then, choose **Create fork** to complete the process. |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +- To clone a repository via command line, run `git clone $URL` in the directory into which you wish to copy the repository. In order to get the value for URL, perform the following steps: |
| 57 | + - Navigate to your repository in GitHub. |
| 58 | + - Select the green button labeled "<> Code". |
| 59 | + - In the Clone section of the Local tab, select the copy button to get the URL. |
| 60 | + |
| 61 | +- After deleting the `pages.yml` file from the `.github/workflows` directory, you can commit and push your changes in a variety of ways. You may use a tool like GitHub Desktop or Visual Studio Code to manage the commit and push process. Alternatively, the following commands will stage your change for commit, commit the change, and then push it to your remote repository. |
| 62 | + |
| 63 | + ```cmd |
| 64 | + git stage . |
| 65 | + git commit -m "Remove pages YAML file" |
| 66 | + git push |
| 67 | + ``` |
| 68 | +
|
| 69 | +</details> |
0 commit comments