Browsing files

You can use Google Cloud Source Repositories to browse to a file in a repository. You can choose to view the latest version of the file, or select a specific version of the file by choosing a branch, tag, or commit.

View the latest version of a file

For most Git repositories, the latest version of a file refers to the last commit of the file in the master branch. You can view this version of a file from the Repository view.

To view the latest version of a file:

  1. From the My Source or All Repositories view, select a repository.

    The File view opens.

  2. Browse to the file you want to view and select it.

Viewing a file using a different branch

  1. From the My Source or All Repositories view, select a repository.

  2. From the Breadcrumb toolbar, select Branch.

  3. Choose the branch you want to view. The view of the repository changes to reflect the selected branch.

  4. Browse to the file you want to view and select it.

Viewing a file using a different tag

  1. From the My Source or All Repositories view, select a repository.

  2. From the Breadcrumb toolbar, select Tag.

  3. Choose the tag you want to view. The view of the repository changes to reflect the selected tag.

  4. Browse to the file you want to view and select it.

Viewing a file at a different commit

  1. From the My Source or All Repositories view, select a repository.

  2. From the Breadcrumb toolbar, select Commit.

  3. Choose the commit you want to view. The view of the repository changes to reflect its state at the selected commit.

  4. Browse to the file you want to view and select it.

Cloud Source Repositories supports an outline view for many common types of files, including those written in Java, C++, Python, JavaScript, and Go. The outline view shows the structure of the file as a tree, where key identifiers are the nodes. The outline view can help you understand the overall structure of a file and navigate its contents.

  1. In the file view, click the Outline tab in the left-hand side of the screen.

    Outline View

  2. Click an identifier to go to its starting location in the file.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Source Repositories