Tags [Learn Git Video Course]

Tower
Tower
1.7 هزار بار بازدید - 4 سال پیش - Learn how to use tags
Learn how to use tags in Git. This video is part of our free 24-part video course on Learning Git on the Command Line.
Subscribe ► @gittower

***************************************

Additional Git tutorials and resources

Learn Git on the Command Line: a free 24-part video course ► What is Version Control? [Learn Git V...

Learn Git with Tower: Learn Git with Tower

Surviving with Git: Surviving with Git

More Productive in Git with Tower: More Productive in Git with Tower

***************************************

Welcome to our video series on learning version control with Git. Today, you'll see how you can use tags in Git. Tags allow you to mark important points in your project's history - for example a release.

A plain "git tag" shows you an alphabetical list of your tags.

Now, let's mark our current commit by tagging it as "version 1". Simply type "git tag" and the name. Any time later, we can run "git show" if we want to know which commit we attached that tag to.

Without any further arguments, the "git tag" command creates a "lightweight" tag. This means that the tag only knows which commit it's attached to. Nothing more.

If you add the "-a" parameter, in contrast, you'll create a so-called "annotated" tag. This has a couple of advantages. First, you can add a message with the "m" parameter:
git tag dash a 2.0    and a message.

Let's look at this tag with "git show":

You'll notice that an annotated tag also saves when it was created and by whom. That's why I'd always recommend adding that -a parameter when creating tags.

In case you want to add a tag to an earlier commit, you can simply add a hash to the end of the command.

And, in case you want to delete a tag, simply use the "-d" parameter:

SUBSCRIBE to learn more about Git, Tower, and how to become a better developer!
@gittower

For more free ebooks, cheat sheets, and video tutorials make sure to check out our FREE learning platform!
https://www.git-tower.com/learn/

STAY UP-TO-DATE:
Tower: https://www.git-tower.com
YouTube: @gittower
Twitter: Twitter: gittower
Facebook: Facebook: gittower

#git #learngit #gittutorial
4 سال پیش در تاریخ 1399/04/04 منتشر شده است.
1,720 بـار بازدید شده
... بیشتر