A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-commit-details.html below:

View commit details in AWS CodeCommit

View commit details in AWS CodeCommit

You can use the AWS CodeCommit console to browse the history of commits in a repository. This can help you identify changes made in a repository, including:

Viewing the history of commits for a branch might also help you understand the difference between branches. If you use tagging, you can also quickly view the commit that was labeled with a tag and the parents of that tagged commit. At the command line, you can use Git to view details about the commits in a local repo or a CodeCommit repository.

Browse commits in a repository

You can use the AWS CodeCommit console to browse the history of commits to a repository. You can also view a graph of the commits in the repository and its branches over time. This can help you understand the history of the repository, including when changes were made.

Note

Using the git rebase command to rebase a repository changes the history of a repository, which might cause commits to appear out of order. For more information, see Git Branching-Rebasing or your Git documentation.

Browse the commit history of a repository

You can browse the commit history for a specific branch or tag of the repository, including information about the committer and the commit message. You can also view the code for a commit.

To browse the history of commits
  1. Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.

  2. In Repositories, choose the repository for which you want to review the commit history.

  3. In the navigation pane, choose Commits. In the commit history view, a history of commits for the repository in the default branch is displayed, in reverse chronological order of the commit date. Date and time are in coordinated universal time (UTC). You can view the commit history of a different branch by choosing the view selector button and then choosing a branch from the list. If you are using tags in your repository, you can view a commit with a specific tag and its parents by choosing that tag in the view selector button.

  4. To view the difference between a commit and its parent, and to see any comments on the changes, choose the abbreviated commit ID. For more information, see Compare a commit to its parent and Comment on a commit. To view the difference between a commit and any other commit specifier, including a branch, tag, or commit ID, see Compare any two commit specifiers.

  5. Do one or more of the following:

View a graph of the commit history of a repository

You can view a graph of the commits made to a repository. The Commit Visualizer view is a directed acyclic graph (DAG) representation of all the commits made to a branch of the repository. This graphical representation can help you understand when commits and associated features were added or merged. It can also help you pinpoint when a change was made in relation to other changes.

Note

Commits that are merged using the fast-forward method do not appear as separate lines in the graph of commits.

To view a graph of commits
  1. Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.

  2. In Repositories, choose the repository for which you want to view a commit graph.

  3. In the navigation pane, choose Commits, and then choose the Commit visualizer tab.

    In the commit graph, the abbreviated commit ID and the subject for each commit message appears next to that point in the graph.

    Note

    The graph can display up to 35 branches on a page. If there are more than 35 branches, the graph is too complex to display. You can simplify the view in two ways:

  4. To render a new graph from a commit, choose the point in the graph that corresponds to that commit. The view selector button changes to the abbreviated commit ID.

View commit details (AWS CLI)

Git lets you view details about commits. You can also use the AWS CLI to view details about the commits in a local repo or in a CodeCommit repository by running the following commands:

To view information about a commit
  1. Run the aws codecommit get-commit command, specifying:

    For example, to view information about a commit with the ID 317f8570EXAMPLE in a CodeCommit repository named MyDemoRepo:

    aws codecommit get-commit  --repository-name MyDemoRepo  --commit-id 317f8570EXAMPLE 
  2. If successful, the output of this command includes the following:

    Here is some example output, based on the preceding example command:

    {
        "commit": {
            "additionalData": "",
            "committer": {
                "date": "1484167798 -0800",
                "name": "Mary Major",
                "email": "mary_major@example.com"
            },
            "author": {
                "date": "1484167798 -0800",
                "name": "Mary Major",
                "email": "mary_major@example.com"
            },
            "treeId": "347a3408EXAMPLE",
            "parents": [
                "4c925148EXAMPLE"
            ],
            "message": "Fix incorrect variable name"
        }
    }
To view information about a merge commit
  1. Run the get-merge-commit command, specifying:

    For example, to view information about a merge commit for the source branch named bugfix-bug1234 with a destination branch named main using the THREE_WAY_MERGE strategy in a repository named MyDemoRepo:

    aws codecommit get-merge-commit --source-commit-specifier bugfix-bug1234 --destination-commit-specifier main --merge-option THREE_WAY_MERGE --repository-name MyDemoRepo
  2. If successful, the output of this command returns information similar to the following:

    {
        "sourceCommitId": "c5709475EXAMPLE", 
        "destinationCommitId": "317f8570EXAMPLE", 
        "baseCommitId": "fb12a539EXAMPLE",
        "mergeCommitId": "ffc4d608eEXAMPLE"
    }
To view information about multiple commits
  1. Run the batch-get-commits command, specifying:

    For example, to view information about commits with the IDs 317f8570EXAMPLE and 4c925148EXAMPLE in a CodeCommit repository named MyDemoRepo:

    aws codecommit batch-get-commits  --repository-name MyDemoRepo  --commit-ids 317f8570EXAMPLE 4c925148EXAMPLE
  2. If successful, the output of this command includes the following:

    Here is some example output, based on the preceding example command:

    {
        "commits": [
          {
            "additionalData": "",
            "committer": {
                "date": "1508280564 -0800",
                "name": "Mary Major",
                "email": "mary_major@example.com"
            },
            "author": {
                "date": "1508280564 -0800",
                "name": "Mary Major",
                "email": "mary_major@example.com"
            },
            "commitId": "317f8570EXAMPLE",
            "treeId": "1f330709EXAMPLE",
            "parents": [
                "6e147360EXAMPLE"
            ],
            "message": "Change variable name and add new response element"
        },
        {
            "additionalData": "",
            "committer": {
                "date": "1508280542 -0800",
                "name": "Li Juan",
                "email": "li_juan@example.com"
            },
            "author": {
                "date": "1508280542 -0800",
                "name": "Li Juan",
                "email": "li_juan@example.com"
            },
            "commitId": "4c925148EXAMPLE",
            "treeId": "1f330709EXAMPLE",
            "parents": [
                "317f8570EXAMPLE"
            ],
            "message": "Added new class"
        }   
    }
To view information about the changes for a commit specifier
  1. Run the aws codecommit get-differences command, specifying:

    For example, to view information about the differences between commits with the IDs 317f8570EXAMPLE and 4c925148EXAMPLE in a CodeCommit repository named MyDemoRepo:

    aws codecommit get-differences  --repository-name MyDemoRepo  --before-commit-specifier 317f8570EXAMPLE --after-commit-specifier 4c925148EXAMPLE
  2. If successful, the output of this command includes the following:

    Here is some example output, based on the preceding example command:

    {
        "differences": [
            {
                "afterBlob": {
                    "path": "blob.txt",
                    "blobId": "2eb4af3bEXAMPLE",
                    "mode": "100644"
                },
                "changeType": "M",
                "beforeBlob": {
                    "path": "blob.txt",
                    "blobId": "bf7fcf28fEXAMPLE",
                    "mode": "100644"
                }
            }
        ]
    }
To view information about a Git blob object
  1. Run the aws codecommit get-blob command, specifying:

    For example, to view information about a Git blob with the ID of 2eb4af3bEXAMPLE in a CodeCommit repository named MyDemoRepo:

    aws codecommit get-blob  --repository-name MyDemoRepo  --blob-id 2eb4af3bEXAMPLE
  2. If successful, the output of this command includes the following:

    For example, the output of the previous command might be similar to the following:

    {
        "content": "QSBCaW5hcnkgTGFyToEXAMPLE="
    }
View commit details (Git)

Before you follow these steps, you should have already connected the local repo to the CodeCommit repository and committed changes. For instructions, see Connect to a repository.

To show the changes for the most recent commit to a repository, run the git show command.

git show

The command produces output similar to the following:

commit 4f8c6f9d
Author: Mary Major <mary.major@example.com>
Date:   Mon May 23 15:56:48 2016 -0700

    Added bumblebee.txt

diff --git a/bumblebee.txt b/bumblebee.txt
new file mode 100644
index 0000000..443b974
--- /dev/null
+++ b/bumblebee.txt
@@ -0,0 +1 @@
+A bumblebee, also written bumble bee, is a member of the bee genus Bombus, in the family Apidae.
\ No newline at end of file

Note

In this and the following examples, commit IDs have been abbreviated. The full commit IDs are not shown.

To view the changes that occurred, use the git show command with the commit ID:

git show 94ba1e60

commit 94ba1e60
Author: John Doe <johndoe@example.com>
Date:   Mon May 23 15:39:14 2016 -0700

    Added horse.txt

diff --git a/horse.txt b/horse.txt
new file mode 100644
index 0000000..080f68f
--- /dev/null
+++ b/horse.txt
@@ -0,0 +1 @@
+The horse (Equus ferus caballus) is one of two extant subspecies of Equus ferus.

To see the differences between two commits, run the git diff command and include the two commit IDs.

git diff ce22850d 4f8c6f9d

In this example, the difference between the two commits is that two files were added. The command produces output similar to the following:

diff --git a/bees.txt b/bees.txt
new file mode 100644
index 0000000..cf57550
--- /dev/null
+++ b/bees.txt
@@ -0,0 +1 @@
+Bees are flying insects closely related to wasps and ants, and are known for their role in pollination and for producing honey and beeswax.
diff --git a/bumblebee.txt b/bumblebee.txt
new file mode 100644
index 0000000..443b974
--- /dev/null
+++ b/bumblebee.txt
@@ -0,0 +1 @@
+A bumblebee, also written bumble bee, is a member of the bee genus Bombus, in the family Apidae.
\ No newline at end of file

To use Git to view details about the commits in a local repo, run the git log command:

git log

If successful, this command produces output similar to the following:

commit 94ba1e60
Author: John Doe <johndoe@example.com>
Date:   Mon May 23 15:39:14 2016 -0700

    Added horse.txt

commit 4c925148
Author: Jane Doe <janedoe@example.com>
Date:   Mon May 22 14:54:55 2014 -0700

    Added cat.txt and dog.txt

To show only commit IDs and messages, run the git log --pretty=oneline command:

git log --pretty=oneline

If successful, this command produces output similar to the following:

94ba1e60 Added horse.txt
4c925148 Added cat.txt and dog.txt

For more options, see your Git documentation.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4