Skip to content

Commit eecddb9

Browse files
author
Matthew McCullough
committed
Merge pull request #50 from randomecho/pro-tip-tags
Tip about tags not coming down the aisle unless you call for them
2 parents 68a8475 + dbdd946 commit eecddb9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

branching/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,41 @@ <h2>
774774
* 17f4acf first commit
775775
</pre>
776776

777+
<p>Tags pointing to objects tracked from branch heads will be
778+
automatically downloaded when you <code>fetch</code> from a remote
779+
repository. However, tags that aren't reachable from branch heads
780+
will be skipped. If you want to make sure <em>all</em> tags are <em>always</em>
781+
included, you must include the <code>--tags</code> option.
782+
</p>
783+
784+
<pre>
785+
<b>$ git fetch origin --tags</b>
786+
remote: Counting objects: 1832, done.
787+
remote: Compressing objects: 100% (726/726), done.
788+
remote: Total 1519 (delta 1000), reused 1202 (delta 764)
789+
Receiving objects: 100% (1519/1519), 1.30 MiB | 1.21 MiB/s, done.
790+
Resolving deltas: 100% (1000/1000), completed with 182 local objects.
791+
From git://github.com:example-user/example-repo
792+
* [new tag] v1.0 -> v1.0
793+
* [new tag] v1.1 -> v1.1
794+
</pre>
795+
796+
<p>If you just want a single tag, use
797+
<code>git fetch &lt;remote> tag &lt;tag-name></code>.
798+
</p>
799+
800+
<p>By default, tags are not included when you <code>push</code> to
801+
a remote repository. In order to explicitly update these you must
802+
include the <code>--tags</code> option when using <code>git push</code>.
803+
</p>
804+
805+
<p class="nutshell">
806+
<b>In a nutshell</b> you use <code>git tag</code> to mark a
807+
commit or point in your repo as important. This also allows
808+
you to refer to that commit with a more memorable reference
809+
than a SHA.
810+
</p>
811+
777812
</div>
778813
</div>
779814

0 commit comments

Comments
 (0)