Learn how to mark a given commit with a tag in SourceTree so as to be able to quickly refer to that commit.
- [Instructor] Periodically, you're going to do a release. And you'll want to mark within SourceTree where that release happened. And so we're going to use a tag. And in fact, there are many uses for tags. You may want to mark a release. You may want to mark a significant change. You may just want to mark things that you want to come back to. Let's come down here to the calculator creation.
And say that we wanted to do a release at that point. We can click on that particular check in, right click, and choose tag. It comes down and asks us to provide a tag name. Let's call this release one point 0. And by the way, if you put a space in; well, let's see what happens when we do. Then there's the commit.
Working copy parent will tag the latest commit. We want a specific commit. And you can see that it uses the hash for that commit. We can also pick from all of the commits, and then have that hash value inserted. Our next choice is do we want to push that tag to origin or do we just want to keep it locally. In our case, we're going to go ahead and push the tag.
Notice that there's advanced options. Here, you can move existing tags, create what are called light weight tags, but notice they're not recommended. And you can sign the tag. We're not going to use any of these advanced options. We're just going to place that tag. It's going to come back and say; release one point 0 is not a valid tag name. There can't be spaces in your tag name. So we're going to collapse this to release one point 0.
And say add that tag. When it's done, notice that there is this tag associated with this check in. We may want to come up here and say that this is where we did the revert to the line before. And so we may want to mark this one with a tag that it was reverted. Just to call attention to that. So we will right click. We will choose tag. We will write note this was reverted.
And go ahead and push that to origin as well. You can put tags on any commit you like. It is generally recommended to use them somewhat sparingly so that you can notice them and call out specific commits.
- SourceTree settings and preferences
- Committing files and messages
- Examining the basic flow
- Branching and merging
- Resolving conflicts
- Reversing the commit
- Adding to the stash
- Restoring from the stash
- Using the Terminal