Updated on 2023-07-25 GMT+08:00

Managing Files

CodeArts Repo allows you to edit and compare files, and trace file changes.

When you access repository details console, the system locates the Files subtab on the Code tab page. You can switch to different branches and tags to view the files in the corresponding version. As shown in the following figure, the file list under the main branch is displayed on the left, the Repository name (file details of a branch or tag version) and History (branch or tag version) tab pages are displayed on the right.

File List

The file list is on the left of the Files tab page of the repository. The file list provides the following functions:

  1. Click a branch name to switch the branch and tag. After the branch and tag are switched, the file directory of the corresponding version is displayed.

  2. Click to display the search box. You can search for files in the file list.

  3. Click . The following functions can be extended:
    • Creating a file

      Creating a file on the CodeArts Repo console is to create a file and run the add, commit, and push commands. A commit record is generated.

      On the Create File page, enter the file name, select the target template type, select the encoding type, enter the file content and commit information, and click OK.

      The Commit Message field is equivalent to the -m message in git commit and can be used for Viewing Associated Work Items.

    • Creating a directory

      Creating a directory on the CodeArts Repo console is to create a folder structure, and run the add, commit, and push commands. A commit record is generated.

      A .gitkeep file is created at the bottom of the directory by default because Git does not allow a commit of an empty folder.

      On the Create Directory page, enter the catalog name and commit information, and click OK.

    • Creating a submodule
    • Uploading a file

      Uploading a file on the CodeArts Repo console is to create a file and run the add, commit, and push commands. A commit record is generated.

      On the Upload File page, select the target file to be uploaded, enter the commit information, and click OK.

    Move the cursor to the folder name and click to perform the preceding operations in the folder.

  4. Move the cursor to the file name and click to change the file name.

    Renaming a file on the CodeArts Repo console is to change a file name, and run the add, commit, and push commands. A commit record is generated.

  5. You can click a file name to display the file content on the right of the page. You can modify the file content, trace file modification records, view historical records, and compare the file content.

Repository Name Tab Page: Viewing File Details of a Branch or Tag Version

By default, the repository name tab page displays file details of the master branch.

It displays the following information:

  • File: name of a file or folder.
  • Commit message: message of the last commit to the file or folder (-m in the commit command). You can click the message to display the commit record.
  • Creator: creator of the last commit to the file or folder.
  • Update time: last update time of the file or folder.

Commit messages are required for the edit and delete operations. They are similar to -m in the git commit command and can be used for associating work items. For details, see Viewing Associated Work Items.

History Tab: Viewing the Commit History of a Branch or Tag Version

The History tab page displays the commit history of a branch or tag version.

On this page, you can perform the following operations on the commit history:

  • Click a commit name to go to the commit details page.
  • Click to extend the following functions:
    • Create Branch.
    • Create Tag: You can create a tag for this commit. For details, see What is a tag.
    • Cherry-Pick: Use the commit as the latest commit to overwrite a branch. It is used to retrieve a version.
    • Revert: undoing this commit
    • Browse Code.

Managing Repository Files

You can click a file name to manage the file. The functions are as follows:

When you maximize the browser window, the functions in the drop-down menu shown in the preceding figure are displayed in tile mode.

  • File name: View the detailed content of the file.
    Table 1 Screen description

    Screen Function

    Function Description

    File Capacity

    Indicates the capacity of the file.

    Full Screen

    Full screen to view the file content

    Copy Code

    Copy the file content to the clipboard.

    Open Raw

    You can view the original data of the file.

    Edit

    Edit the file online.

    Download

    Download the file to the local PC.

    Delete

    Delete a file

    File content

    The email content is displayed.

    Click this icon to add review comments.

  • Blame: View the change history of a file and trace operations.

    On this tab page, a modifier corresponds to their modified content. You can a record to view the commit details.

  • History: View the commit history of the file.

    On this page, you can perform the following operations on the commit history:

    • Click a commit name to go to the commit details page.
    • provides the following functions:
      • Create Branch.
      • Create Tag: You can create a tag for this commit. (Introduction)
      • Cherry-Pick: Use the commit as the latest commit to overwrite a branch. It is used to retrieve a version.
      • Revert: undoing this commit
      • Browse Code.
  • Comparison: compares the committed differences.

    The differences compared on the CodeArts Repo console are displayed in a better way than those on the Git Bash client. You can select different commit batches on the GUI for difference comparison.

    The comparison result shows the impact of merging from the left repository version to the right repository version on the files in the right repository. If you want to know the differences between the two file versions, you can adjust the left and right positions, compare them again, and learn all the differences based on the two results.