GitKraken usage tutorial - basic part (6)

4) Abandon the changes of this document

In some cases, when the compilation fails due to code changes, you want to give up this modification to the file and restore the file to the state after the last submission. A simple way to restore the file is to use the Unstaged Files Find this file (such as the Chip_ADC.h file) in the list, right-click, and the menu as shown in the figure appears:

Figure 1-10 Staging area file options

Click on Discard changes and a prompt will appear at the top of the program: This will discard… Are you sure…?

Then click the red button in the image below to discard the changes.

Figure 1-11 Abandoning the modification of the file

This will discard this modification to the file and restore the file to the state of the last commit. However, please note that doing so will cause all modifications to this file to be discarded, which needs to be treated with caution.

The recommended way is to click on the file in the Unstaged Files list to view the changes, and click the Discard Hunk button where no changes are needed to discard the changes in this part.

5) Modify the description information of the submission record

As shown in the figure below, taking the Test warehouse as an example, click a commit record in the commit record area (such as the current record pointed to by the local master branch)

Figure 1-12 Commit record area

The information of this submission record will appear in the workspace interface on the right side of the program, as shown in Figure 1‑13.

Figure 1-13 Workspace interface

In Figure 1‑13:

The first area is the description information filled in when submitting this record. Click the box to modify the description information.

The second area is the file information submitted this time. The figure shows that this submission has modified a file, which is the 19264.h file.

6) View the history modification of the file

Right-click the 19264.h file in Figure 1‑13, and the options of File History and File Blame will appear in the right-click menu. Both options can display the modification history of the file, and the time span of the modification history is from the first commit record to the currently selected commit record.

Figure 1-14 Right-click menu for history modification

File History will display the difference between each commit record and the previous commit record in the form of Diff View;

File Blame will display the contents of the completed file in the form of File View.

Click on one of them, and the file history list as shown below will appear:

Figure 1-15 The modification history of the file

There are only two commits where the file has been modified. Click the commit record in the history to view the changes of the file in this commit record.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325044361&siteId=291194637