Menu
AWS CodeCommit
User Guide (API Version 2015-04-13)

Compare Commits in AWS CodeCommit

You can use the AWS CodeCommit console to view the differences between commit specifiers in an AWS CodeCommit repository. You can quickly view the difference between a commit and its parent. You can also compare any two references, including commit IDs.

Compare a Commit to Its Parent

You can quickly view the difference between a commit and its parent to review the commit message, the committer, and exactly what changed.

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

  2. On the Dashboard page, from the list of repositories, choose the repository where you want to view the difference between a commit and its parent.

  3. In the navigation pane, choose Commits.

  4. Choose the abbreviated commit ID of any commit in the list. The view changes to show details for this commit, including the differences between it and its parent commit.

    
                        Choose the abbreviated commit ID to show differences between this commit and its parent

    You can show changes side by side (Split view) or inline (Unified view). You can also hide or show white space changes.

    Note

    If you are signed in as an IAM user, you can configure and save your preferences for viewing code and other console settings. For more information, see Working with User Preferences.

    
                        Changes shown in Split view, with white space
                            changes visible

    Note

    Depending on line ending style, your code editor, and other factors, you might see entire lines added or deleted instead of specific changes in a line. The level of detail matches what's returned in the git show or git diff commands.

    
                            Changes shown in Split view, with white
                                space changes visible
  5. To compare a commit to its parent from the Commit Visualizer page, choose a reference point on the graph, and then choose View differences between this commit and its parent.

    
                        The option to view differences between a commit and its parent in
                                Commit Visualizer

Compare Any Two Commit Specifiers

You can view the differences between any two commit specifiers in the AWS CodeCommit console. Commit specifiers are references, such as branches, tags, and commit IDs.

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

  2. On the Dashboard page, from the list of repositories, choose the repository where you want to compare commits, branches, or tagged commits.

  3. In the navigation pane, choose Compare.

    
                        Compare any two commit specifiers
  4. Use the Choose buttons to compare two commit specifiers.

    • To compare the tip of a branch, choose the branch name. This selects the most recent commit from that branch for the comparison.

    • To compare a commit with a specific tag associated with it, choose the tag name. This selects the tagged commit for the comparison.

    • To compare a specific commit, paste the commit ID in the text box. To get the full commit ID, choose Commits in the navigation bar, and copy the commit ID from the list. On the Compare page, paste the full commit ID in the text box, and press Enter. You can repeat this to copy and paste a second commit ID, if you want to compare two commit IDs.

      
                            Compare branches, tags, or commit IDs
  5. After you have selected the specifiers, choose Compare.

    
                        The comparison view between two commit specifiers

    You can show differences side by side (Split view) or inline (Unified view). You can also hide or show white space changes.

  6. To reverse the comparison, choose the Flip button ( 
                        The flip button for changing the order of comparison.
                    ), and then choose Compare.

  7. To clear your comparison choices, choose Clear.