Tag Archives: Please clean your repository working tree before checkout

[Solved] Please clean your repository working tree before checkout

Write down a git error:  please clean your repository working tree before checkout

This error is reported if you want to refresh the code. Analysis is not added or submitted after modification.

If you think there may be a code conflict, you add the code first, submit it, and then pull it. After pushing, no error is found,

Add first, submit and then perform subsequent operations

The GIT add command writes the contents to the staging area

The GIT commit command adds the contents of the staging area to the local repository. Git commit – M [message]

 

Restore previous version

There are two operations to restore the previous version

git reset

Restore to a previously submitted version, and delete all submitted versions after that version. We don’t want it

git revert

Is to undo a previous version, keep all subsequent versions, and generate a new version,

 

The general workflow of Git is as follows:

1.Clone the GIT resource as the working directory.

2.Add or modify files on cloned resources.

3.If someone else changes it, you can update the resource.

4.View changes before submitting.

5.Submit changes.

6.After the modification is completed, if an error is found, the submission can be withdrawn and modified and submitted again.