[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Viewing commit changes\n\nYou might want to see the specific changes that someone made to the files in a commit. In Cloud Source Repositories, you can views these changes by using the Files Changed section of the Commit Details view.\n\n\u003cbr /\u003e\n\nAccess the Commit Details view\n------------------------------\n\nYou can access the Commit Details view in the following ways:\n\n- From the Change History panel\n- From the Commit link\n\nBoth options are available when you open a file or folder in\nCloud Source Repositories.\n\nThe following table lists examples of fields you can access\nin your commit event:\n\nFor a list of additional fields, see [CommitInfo](https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#commit-info).\n\n### Use the Change History panel\n\n1. In the Google Cloud console, open Cloud Source Repositories.\n\n [Open Cloud Source Repositories](https://source.cloud.google.com/repos)\n\n The **All repositories** page opens. Alternatively, you can open the\n [My source](/source-repositories/docs/browsing-repositories#browsing_to_a_repository)\n view.\n2. Click a repository.\n\n The **Repository Root** page opens.\n3. In the **Files** list, browse to the file you want to view, and then click\n it.\n\n4. In the adjacent pane, click **Change history**.\n\n In the pane that is displayed, each row shows the\n hash ID for that commit formatted as a hyperlink.\n5. Click the hash ID link.\n\n The [Commit Details](/source-repositories/docs/commit-details-overview) view opens.\n\n### Use the Commit Information link\n\nYou can also open the Commit Details view by clicking the Commit link.\n\nIf you're viewing the latest version of the file for that branch, the Commit\nInformation link displays the name of the branch, along with the hash\nof latest commit.\n\nIf you're looking at a previous version of a file or folder, the Commit\nInformation link displays the hash of the commit.\n\nIf you're looking at a particular tag, the Commit Information link displays\nthe hash associated with the tag.\n\nIn all of these cases, click the hash of the commit to open the\nCommit Details view.\n\nView line changes\n-----------------\n\nYou can use the Commit Details view to see which lines were changed in each\nfile. To view which lines changed in a file, follow these steps.\n\n1. [Access the Commit Details](#accessing_the_commit_details_view)\n view for a specific commit.\n\n2. Locate the file you want to view, and then click the down arrow\n expand_more to expand that row.\n\n The Files Changed section expands to display the changes made in that file.\n\nIf you want to simultaneously view all changes to a file, click **Expand\nAll** in the Files Changed section.\n\nDiff a file\n-----------\n\nTo learn more about the changes to a specific file, open the Diff\nview. This view provides a diff of the file against the previous commit. You\ncan also select other commits to compare the file against.\n\nTo diff a file, follow these steps:\n\n1. [Access the Commit Details](#accessing_the_commit_details_view)\n view for a specific commit.\n\n2. Click the path link for the file you want to view.\n\n The Diff view opens. This view contains two panels. One panel displays\n the previous version of the file. The other panel displays the file as it\n existed at the time of the commit.\n\nCompare commits\n---------------\n\nAnother way to learn about how your code has changed over time is to compare\none commit to another.\n\nTo compare two commits, follow these steps:\n\n1. [Access the Commit Details](#accessing_the_commit_details_view)\n view for a specific commit.\n\n2. Click **Compare**.\n\n The Compare screen opens. This screen allows you to select two different\n commits. By default, this screen compares the commit you selected when you\n opened the Commit Details screen to its immediate [parent](#navigating_to_a_parent_commit).\n\n You can select different commits using the **Commit** and **To Parent**\n drop-down lists on the Breadcrumb.\n\nNavigate to a parent commit\n---------------------------\n\nViewing the details of a specific commit can tell you a lot about what files\nwere changed and why. You can get an even better understanding of your code's\nhistory by viewing the parent commit. A parent commit is a commit on which the\ncurrent commit is based.\n\nTo access the parent commit, follow these steps:\n\n1. [Access the Commit Details](#accessing_the_commit_details_view)\n view for a specific commit.\n\n2. Click the link next to the **Parent**.\n\nOften, a given commit has only a single parent. But there are times when a\ncommit has multiple parents. This happens when a commit is the result of a merge\nof two or more branches. If a commit has multiple parents, the Commit Details\nview provides a drop-down list that you can use to diff against, and navigate\nto, a specific parent."]]