View Git tag details in AWS CodeCommit - AWS CodeCommit

AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal. Learn more"

View Git tag details in AWS CodeCommit

In Git, a tag is a label you can apply to a reference like a commit to mark it with information that might be important to other repository users. For example, you might tag the commit that was the beta release point for a project with the tag beta. For more information, see Use Git to create a tag. Git tags are different from repository tags. For more information about how to use repository tags, see Add a tag to a repository.

You can use the AWS CodeCommit console to view information about Git tags in your repository, including the date and commit message of the commit referenced by each Git tag. From the console, you can compare the commit referenced by the tag with the head of the default branch of your repository. Like any other commit, you can also view the code at the point of that Git tag.

You can also use Git from your terminal or command line to view details about Git tags in a local repo.

View tag details (console)

Use the AWS CodeCommit console to quickly view a list of Git tags for your repository and details about the commits referenced by the Git tags.

  1. Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.

  2. In Repositories, choose the name of the repository where you want to view tags.

  3. In the navigation pane, choose Git tags.

    A view of tags in a repository.
  4. Do one of the following:

    • To view the code as it was at that commit, choose the Git tag name.

    • To view details of the commit, including the full commit message, committer, and author, choose the abbreviated commit ID.

View Git tag details (Git)

To use Git to view details about Git tags in a local repo, run one of the following commands:

  • git tag to view a list of Git tag names.

  • git show to view information about a specific Git tag.

  • git ls-remote to view information about Git tags in a CodeCommit repository.

Note

To ensure that your local repo is updated with all of the Git tags in the CodeCommit repository, run git fetch followed by git fetch --tags.

In the following steps, we assume that you have already connected the local repo to a CodeCommit repository. For instructions, see Connect to a repository.

To view a list of Git tags in a local repo

  1. Run the git tag command:

    git tag
  2. If successful, this command produces output similar to the following:

    beta release
    Note

    If no tags have been defined, git tag returns nothing.

For more options, see your Git documentation.

To view information about a Git tag in a local repo

  1. Run the git show tag-name command. For example, to view information about a Git tag named beta, run:

    git show beta
  2. If successful, this command produces output similar to the following:

    commit 317f8570...ad9e3c09 Author: John Doe <johndoe@example.com> Date: Tue Sep 23 13:49:51 2014 -0700 Added horse.txt diff --git a/horse.txt b/horse.txt new file mode 100644 index 0000000..df42ff1 --- /dev/null +++ b/horse.txt @@ -0,0 +1 @@ +The horse (Equus ferus caballus) is one of two extant subspecies of Equus ferus \ No newline at end of file
    Note

    To exit the output of the Git tag information, type :q.

For more options, see your Git documentation.

To view information about Git tags in a CodeCommit repository

  1. Run the git ls-remote --tags command.

    git ls-remote --tags
  2. If successful, this command produces as output a list of the Git tags in the CodeCommit repository:

    129ce87a...70fbffba refs/tags/beta 785de9bd...59b402d8 refs/tags/release

    If no Git tags have been defined, git ls-remote --tags returns a blank line.

For more options, see your Git documentation.