-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
85 lines (51 loc) · 1.91 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<<<<<<< HEAD
$ git checkout -b dev
Switched to a new branch "dev"
This is shorthand for:
$ git branch dev
$ git checkout dev
$ vim index.html
$ git commit -a -m 'added a new file [dev]'
$ git checkout master
Switched to branch 'master'
$ git checkout master
$ git merge dev
<<<<<<< HEAD
=======
>>>>>>> c7828c39fb806e2923e9ccce041610e7d5bb0bc1
=======
### Listing Your Tags #####
$ git tag
>>>>>>> dev
$ git tag -l "v1.8.5*"
### Creating Tags ####
Git uses two main types of tags: lightweight and annotated.
A lightweight tag is very much like a branch that doesn’t change – it’s just a pointer to a specific commit.
Annotated tags, however, are stored as full objects in the Git database. They’re checksummed; contain the tagger name, email, and date; have a tagging message; and can be signed and verified with GNU Privacy Guard (GPG). It’s generally recommended that you create annotated tags so you can have all this information; but if you want a temporary tag or for some reason don’t want to keep the other information, lightweight tags are available too.
###### Annotated Tags ##########
Creating an annotated tag in Git is simple. The easiest way is to specify -a when you run the tag command:
$ git tag -a v1.4 -m "my version 1.4"
$ git tag
v0.1
v1.3
v1.4
$ git show v1.4-lw
$ git log --pretty=oneline
Now, suppose you forgot to tag the project at v1.2, which was at the “updated rakefile” commit. You can add it after the fact. To tag that commit, you specify the commit checksum (or part of it) at the end of the command:
$ git tag -a v1.2 9fceb02
You can see that you’ve tagged the commit:
$ git tag
v0.1
v1.2
v1.3
v1.4
v1.4-lw
v1.5
$ git show v1.2
############ Sharing Tags ##########
git push origin [tagname].
$ git push origin v1.5
############ Checking out Tags ###########
git checkout -b [branchname] [tagname]:
$ git checkout -b version2 v2.0.0
Switched to a new branch 'version2'