You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explanation: "Correct! Version control is one of the practices included in software configuration management (SCM)."
40
40
- content: 'What’s the difference between Git and GitHub?'
41
41
choices:
42
42
- content: "Git lets you work with one or more local branches and push changes to a remote repository. GitHub acts as the remote repository, which is accessed through a website or command-line tools."
43
43
isCorrect: true
44
44
explanation: "Correct! Git is the tool you can use to work with a local branch and push changes to a remote repository. GitHub acts as the remote repository."
45
45
- content: "Git is a distributed version control system (DVCS) that runs in the cloud. GitHub is an interface layer that provides access to Git technology."
46
46
isCorrect: false
47
-
explanation: "Incorrect. Users have access to both Git and GitHub. GitHub is a cloud platform that uses the Git DVCS."
47
+
explanation: "Incorrect. Git runs locally on your computer, not in the cloud. GitHub is a cloud platform that uses Git as its core technology."
48
48
- content: "Git is used by an individual contributor. GitHub is used by multiple contributors to simplify group development work."
49
49
isCorrect: false
50
50
explanation: "Incorrect. Both Git and GitHub are used by individual contributors and by teams to facilitate working together."
@@ -55,7 +55,7 @@ quiz:
55
55
explanation: "Incorrect. The `git init` command is used to initialize a new Git repository."
56
56
- content: "`git status`"
57
57
isCorrect: false
58
-
explanation: "Incorrect. The `git status` command lets you see which changes are currently being tracked by Git."
58
+
explanation: "Incorrect. The `git status` command shows the state of your working tree and staging area, including staged, modified, and untracked files."
59
59
- content: "`git help`"
60
60
isCorrect: true
61
61
explanation: "Correct! Use `git help` to view information about how to use Git."
Imagine you're a new software developer at a firm that writes avionics software for commercial airliners. Quality control is critical, and developers work in small teams using Git for version control. You've heard of version control, but you've never used Git, so you're eager to catch up!
2
2
3
-
You decide to build a website that lets you and your friends share pictures of your cats, so you can learn Git in a fun environment before bringing that knowledge to work. You set out to build the site by using Git to keep track of changes and keep all the source code files backed up in case the server goes down. But before diving head-first into Git, you must cover the basics
3
+
You decide to learn Git by working through a hands-on exercise where you create a repository, make commits, explore history, and experiment with branches. But before diving head-first into Git, you must cover the basics.
4
4
5
-
In this module, you'll get an introduction to version control, and Git. Git can seem a little cryptic at first, and it can even be frustrating at times. But if you learn it step by step, you'll find that there's a reason Git is quickly becoming the world's most popular version control system—not just for software developers, but also for teams that write documentation and collaborate on other work.
5
+
In this module, you'll get an introduction to version control, and Git. Git can seem a little cryptic at first, and it can even be frustrating at times. But if you learn it step by step, you'll find that there's a reason Git is the world's most popular version control system—not just for software developers, but also for teams that write documentation and collaborate on other work.
6
6
7
7
### Watch a video
8
8
9
-
For an overview of the exercises in this module, see the video [Introduction to Git Recap](https://www.youtube.com/watch?v=9uGS1ak_FGg?azure-portal=true).
9
+
For an overview of the exercise in this module, see the video [Introduction to Git Recap](https://www.youtube.com/watch?v=9uGS1ak_FGg&azure-portal=true).
10
10
11
11
## Learning objectives
12
12
13
13
In this module, you'll:
14
14
15
15
- Learn what version control is
16
16
- Understand distributed version control systems, like Git
17
-
- Recognize the differences between Git and GitHub and the roles they play in the software development lifecycle
17
+
- Configure your Git identity and create a new Git project
18
+
- Make and track changes to code by using Git
19
+
- Work with branches to experiment safely
18
20
19
21
20
22
## Prerequisites
21
23
22
-
None.
24
+
- A [GitHub](https://github.com?azure-portal=true) account.
25
+
- Basic familiarity with using a command-line interface (CLI).
26
+
- A code editor, such as [Visual Studio Code](https://code.visualstudio.com?azure-portal=true).
Copy file name to clipboardExpand all lines: learn-pr/student-evangelism/intro-to-git/includes/1-what-is-vc.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
A version control system (VCS) is a program or set of programs that tracks changes to a collection of files. One goal of a VCS is to easily recall earlier versions of individual files or of the entire project. Another goal is to allow several team members to work on a project, even on the same files, at the same time without affecting each other's work.
2
2
3
-
Another name for a VCS is a software configuration management (SCM) system. The two terms often are used interchangeably—in fact, Git's official documentation is located at [git-scm.com](https://git-scm.com/?azure-portal=true). Technically, version control is just one of the practices involved in SCM. A VCS can be used for projects other than software, including books and online tutorials.
3
+
Version control is often discussed as part of software configuration management (SCM). The two terms sometimes are used interchangeably—in fact, Git's official documentation is located at [git-scm.com](https://git-scm.com/?azure-portal=true). Technically, version control is just one of the practices involved in SCM. A VCS can be used for projects other than software, including books and online tutorials.
4
4
5
5
With a VCS, you can:
6
6
@@ -16,27 +16,27 @@ Git is a fast, versatile, highly scalable, free, open-source VCS. Its primary au
16
16
17
17
## Distributed version control
18
18
19
-
Earlier instances of VCSes, including CVS, Subversion (SVN), and Perforce, used a centralized server to store a project's history. This centralization meant that the one server was also potentially a single point of failure.
19
+
Centralized VCSes, including CVS, Subversion (SVN), and Perforce, use a centralized server to store a project's history. This centralization means that the one server is also potentially a single point of failure.
20
20
21
-
Git is _distributed_, which means that a project's complete history is stored both on the client *and*on the server. You can edit files without a network connection, check them in locally, and sync with the server when a connection becomes available. If a server goes down, you still have a local copy of the project. Technically, you don't even have to have a server. Changes could be passed around in e-mail or shared by using removable media, but no one uses Git this way in practice.
21
+
Git is _distributed_, which means that a project's complete history is stored on your local computer and, when you use one, on a server. You can edit files without a network connection, commit them locally, and sync with the server when a connection becomes available. If a server goes down, you still have a local copy of the project. Technically, you don't even have to have a server. Changes can be passed around in e-mail or shared by using removable media, although most teams today use a hosted remote repository.
22
22
23
23
## Git terminology
24
24
25
-
To understand Git, you have to understand the terminology. Here's a short list of terms that Git users frequently use. Don't be concerned about the details for now; all these terms will become familiar as you work your way through the exercises in this module.
25
+
To understand Git, you have to understand the terminology. Here's a short list of terms that Git users frequently use. Don't be concerned about the details for now; all these terms will become familiar as you work your way through the exercise in this module.
26
26
27
27
-**Working tree**: The set of nested directories and files that contain the project that's being worked on.
28
28
29
-
-**Repository (repo)**: The directory, located at the top level of a working tree, where Git keeps all the history and metadata for a project. Repositories are almost always referred to as *repos*. A *bare repository* is one that isn't part of a working tree; it's used for sharing or backup. A bare repo is usually a directory with a name that ends in *.git*—for example, *project.git*.
29
+
-**Repository (repo)**: The data store, contained in a hidden directory named `.git` at the top level of a working tree, where Git keeps all the history and metadata for a project. Repositories are almost always referred to as *repos*. A *bare repository* is one that isn't part of a working tree; it's used for sharing or backup. A bare repo is usually a directory with a name that ends in *.git*—for example, *project.git*.
30
30
31
-
-**Hash**: A number produced by a hash function that represents the contents of a file or another object as a fixed number of digits. Git uses hashes that are 160 bits long. One advantage to using hashes is that Git can tell whether a file has changed by hashing its contents and comparing the result to the previous hash. If the file time-and-date stamp is changed, but the file hash isn’t changed, Git knows the file contents aren’t changed.
31
+
-**Hash**: A number produced by a hash function that represents the contents of a file or another object as a fixed number of digits. Git traditionally uses SHA-1 hashes that are 160 bits long, though modern versions of Git also support SHA-256 (256 bits). One advantage to using hashes is that Git can tell whether a file has changed by hashing its contents and comparing the result to the previous hash. If the file time-and-date stamp is changed, but the file hash isn’t changed, Git knows the file contents aren’t changed.
32
32
33
-
-**Object**: A Git repo contains four types of *objects,* each uniquely identified by an SHA-1 hash. A *blob* object contains an ordinary file. A *tree* object represents a directory; it contains names, hashes, and permissions. A *commit* object represents a specific version of the working tree. A *tag*is a name attached to a commit.
33
+
-**Object**: A Git repo contains four types of *objects*, each uniquely identified by a hash. A *blob* object contains an ordinary file. A *tree* object represents a directory; it contains names, hashes, and permissions. A *commit* object represents a specific version of the working tree. An annotated *tag*object stores metadata, such as a name, message, and optional signature, and usually points to a commit, though it can point to other Git objects as well. Git also supports lightweight tags, which are references rather than objects.
34
34
35
35
-**Commit**: When used as a verb, *commit* means to make a commit object. This action takes its name from commits to a database. It means you are committing the changes you have made so that others can eventually see them, too.
36
36
37
-
-**Branch**: A branch is a named series of linked commits. The most recent commit on a branch is called the *head*. The default branch, which is created when you initialize a repository, is called `main`, often named `master` in Git. The head of the current branch is named `HEAD`. Branches are an incredibly useful feature of Git because they allow developers to work independently (or together) in branches and later merge their changes into the default branch.
37
+
-**Branch**: A branch is a named series of linked commits. The most recent commit on a branch is called the *head*. The default branch, which is created when you initialize a repository, is called `main` on GitHub and many other platforms. The head of the current branch is named `HEAD`. Branches are an incredibly useful feature of Git because they allow developers to work independently (or together) in branches and later merge their changes into the default branch.
38
38
39
-
-**Remote**: A remote is a named reference to another Git repository. When you create a repo, Git creates a remote named `origin` that is the default remote for push and pull operations.
39
+
-**Remote**: A remote is a named reference to another Git repository. When you clone a repo, Git creates a remote named `origin` that points to the repository you cloned from. `origin` is the default remote for push and pull operations.
40
40
41
41
-**Commands**, **subcommands**, and **options**: Git operations are performed by using commands like `git push` and `git pull`. `git` is the command, and `push` or `pull` is the subcommand. The subcommand specifies the operation you want Git to perform. Commands frequently are accompanied by options, which use hyphens (-) or double hyphens (--). For example, `git reset --hard`.
42
42
@@ -46,7 +46,7 @@ These terms and others, like `push` and `pull`, will make more sense shortly. Bu
46
46
47
47
Several different GUIs are available for Git, including GitHub Desktop. Many programming editors, like Microsoft [Visual Studio Code](https://code.visualstudio.com/?azure-portal=true), also have an interface to Git. They all work differently and they have different limitations. None of them implement _all_ of Git's functionality.
48
48
49
-
The exercises in this module use the Git command line—specifically, Git commands executed in Azure Cloud Shell. However, Git's command-line interface works the same, no matter what operating system you're using. Plus, the command line lets you tap into *all* of Git's functionality. Developers who see Git only through a GUI sometimes find themselves confronted with error messages they can't resolve, and they have to resort to the command line to get going again.
49
+
The exercise in this module uses a combination of the Git command line and Visual Studio Code in a GitHub Codespaces environment. Git's command-line interface works the same, no matter what operating system you're using. Plus, the command line lets you tap into *all* of Git's functionality. Developers who see Git only through a GUI sometimes find themselves confronted with error messages they can't resolve, and they have to resort to the command line to get going again.
50
50
51
51
## Git and GitHub
52
52
@@ -66,7 +66,9 @@ Key features provided by GitHub include:
66
66
- Actions
67
67
- Forks
68
68
- Projects
69
+
- Copilot
70
+
- Codespaces
69
71
70
-
To learn more about GitHub, see the [Introduction to GitHub](/training/modules/introduction-to-github?azure-portal=true) Microsoft Learn module or the [Getting started with GitHub](https://docs.github.com/free-pro-team@latest/github/getting-started-with-github?azure-portal=true) help documentation.
72
+
To learn more about GitHub, see the [Introduction to GitHub](/training/modules/introduction-to-github?azure-portal=true) Microsoft Learn module or the [Getting started with GitHub](https://docs.github.com/en/get-started?azure-portal=true) help documentation.
Copy file name to clipboardExpand all lines: learn-pr/student-evangelism/intro-to-git/includes/2-exercise-configure-git.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ This exercise checks your knowledge of Git fundamentals, including version contr
2
2
3
3
## Getting started
4
4
5
-
When you select the **Copy Exercise** button below, you'll be navigated to a public GitHub template repositorythat prompts you to complete a series of small challenges.
5
+
When you select the **Start the exercise on GitHub** button below, you'll be taken to a public GitHub template repository. Select the **Copy Exercise** button on that page to copy the exercise to your own account, then complete a series of small challenges.
6
6
7
7
When you've finished the exercise in GitHub, return here for:
0 commit comments