Git Notes (3)

Modify the content of the last commit

  • Use the command git commit --amend -m "说明"to modify the description of the latest submission. If you do not add the -m parameter, you will enter a vim editor and change the submission description.

delete files using git

  • Using the command git rm filename, filename indicates the path + name of the deleted file, but it should be noted that the file in the working directory is deleted at this time, and the file in the temporary storage area is deleted, but the local warehouse has not changed, so it is necessary to execute the local warehouse. Perform a commit operation so that the repository is updated.
  • When using the command git rm -f filename, the file filename will be forced to be deleted.

change filename

  • Using the command git mv oldfilename newfilename, the old file name is changed to the new file name at this time, but only the files in the staging area are modified at this time, and the modifications need to be submitted to the local warehouse. This command is equivalent to doing the following:
mv oldfilename newfilename
git add newfilename

Guess you like

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