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
Copy file name to clipboardExpand all lines: book/17_tags_and_releases.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,29 @@ You may want to put tags or releases on certain commits in your code's history t
4
4
5
5
### Tags
6
6
7
-
A tag is a pointer that points to a specific commit. Unlike commits, tags are _not_ immutable. They can be moved and changed. Before we get into Releases, let's practice a bit with tags.
7
+
A tag is a pointer that points to a specific commit. Unlike commits, tags are _not_ immutable. They can be moved and changed. Let's practice a bit with tags.
8
8
9
-
When creating a tag from the command line, you can make a "lightweight" or an "annotated" tag. The following example creates an annotated tag with the `-a` flag, names the tag `v1.0`, and connects it to whichever commit SHA is included.
9
+
When creating a tag from the command line, it's recommended to create an "annotated" tag. The following example creates an annotated tag with the `-a` flag, names the tag `v1.0`, and connects it to whichever commit SHA is included.
10
10
11
11
-`git tag -a v1.0 <SHA>`
12
12
13
13
To see all tags, type `git tag --list`.
14
14
15
-
Another caveat with tags is that they are not automatically pushed up with commits. To push tags, type `git push <remote> --tags`.
15
+
Another caveat with tags is that they are not automatically pushed up with commits. To push tags, type `git push --tags`.
16
+
17
+
You can also set this as a default with configs using `git config push.followTags true` which will automatically push tags when their associated commits will be pushed. [Read more about tags here](https://git-scm.com/docs/git-config/2.4.1#git-config-pushfollowTags).
16
18
17
19
### Releases
18
20
19
-
Releases are similar to tags, because they point to a specific commit and can be named like any other tag. However, releases can also include attached binaries. This means you can upload and store the compiled program for others to download, and have that compiled version be attached to the exact source code that composes it. We recommend using GitHub Releases in place of tags; a tag will still be created, but it will have a GitHub linked history that cannot be changed.
21
+
Releases are similar to tags, because they point to a specific commit and can be named like any other tag. However, releases can also include attached binaries. This means you can upload and store the compiled program for others to download, and have that compiled version be attached to the exact source code that composes it. Tags can be created locally with Git, or on GitHub. However, releases are a GitHub feature that allow you to add an executable to the tag for easier access by visitors who just want to download and install your software.
20
22
21
23
### Add a Release to GitHub-Games
22
24
23
25
1. On GitHub, navigate to the main page of the repository.
24
26
1. Under your repository name, click Releases.
25
27
1. Click Draft a new release.
26
-
1. Type a version number for your release. Versions are based on Git tags. We recommend naming tags that fit within semantic versioning.
27
-
1. Select a branch that contains the project you want to release. Usually, you'll want to release against your master branch, unless you're releasing beta software.
28
+
1. Type a name for the tag. We recommend you use semantic versioning.
29
+
1. Select a branch that contains the project you want to release. Usually, you'll want to release against your master branch, unless you're releasing beta software. You can also select a recent commit by clicking the drop down and choosing recent commits.
28
30
1. Type a title and description that describes your release.
29
31
1. If you're ready to publicize your release, click Publish release. Otherwise, click Save draft to work on it later.
0 commit comments