When viewing a file in Cloud Source Repositories, use the Blame or History options to learn more about changes to the file view, such as what lines changed and when.
View the Blame pane
The Blame pane displays information about who made what change to a file and when.
For each line in the file, this panel displays:
- The name of the user who authored the commit.
- A number that indicates when the change occurred in the history of that file.
A username and change number can appear multiple times for a given file. For example, if a user changed multiple lines in a file and submitted those changes in a single commit, each affected line would contain the same username and change number.
To open the Blame pane, follow these steps:
In the Google Cloud console, open Cloud Source Repositories.
Open Cloud Source Repositories
The All repositories page opens. Alternatively, you can open the My source view.
Click a repository.
Browse to the file you want to view and click it.
In the upper-right corner, click Blame.
View additional details about a commit
With the Blame pane in view, you can view additional details about a change to a file.
To see additional details, hover over the change number and the author's name in the Blame pane.
A Commit Details dialog appears, which displays information such as:
- The Commit ID
- A description of the commit
- The author commit date
- The name of the author
To open the change history for this file, click Show in change history in the dialog.
View the history of a file
You can also learn about how a file changed over time through the History option. This option opens a Change History section, which contains information about each commit that affected the file.
You can view the history for a file from the File view or the Blame layer.
File view
In the Google Cloud console, open Cloud Source Repositories.
Open Cloud Source Repositories
The All repositories page opens. Alternatively, you can open the My source view.
Click a repository.
Browse to the file you want to view and select it.
Click Change history in the lower corner of the page.
The Commit History panel displays a list of commits. Each row displays the hash for that commit as a hyperlink.
Blame pane
In the Google Cloud console, open Cloud Source Repositories.
Open Cloud Source Repositories
The All repositories page opens. Alternatively, you can open the My source view.
Click a repository.
Browse to the file you want to view and click it.
In the upper-right corner, click Blame.
Choose one of the following options:
- Click the change number.
- Hold the pointer over the change number or author's name to open the Commit Details dialog, and then click Show in change history.
Open a file as it existed for a specific commit
Open the Change History pane using either the Blame pane or the Change History pane.
The Change History pane opens.
Locate the commit.
Hold the pointer over that commit's row.
A View button displays on the same row as the commit.
Click View.