(Individual) VR Taijiquan Learning System - Fourth and Fifth Weeks of Innovative Training (1)

recent work

A few days ago, due to personal reasons (preparing for the GRE test), my work here was stagnant for a while. During this time, I mainly dealt with some issues related to version control. I will record the more important parts below:

git delete file

I accidentally submitted a 1.2G file to the local warehouse when I submitted my work before. When it was pushed, github rejected the submission, indicating that files larger than 1G cannot be uploaded. This is more troublesome, because the file has been tracked by git, so even if it is deleted, the record will still be kept in git, so it is useless to delete it directly, so its record needs to be completely deleted from the warehouse. To do this, use the following command:

git filter-branch --force --index-filter \ 
    'git rm --cached --ignore-unmatch path_to_file' \ 
    --prune-empty --tag-name-filter cat -- --all

Fill in the file to be deleted at path_to_file, and execute the command to delete it from the warehouse. The following is the meaning of each parameter:

  • The function of the filter-branch parameter is to let git rewrite each branch
  • --force force even if conflict is encountered
  • –index-filter specifies what command to execute when rewriting, here is the following git rm –cached –ignore-unmatch path_to_file, if there is a match, delete the cached file
  • --prune-empty indicates that if the rewrite causes some commits to be empty, then ignore this commit
  • --tag-name-filter indicates how to rename each tag. The renamed command follows it. The current tag will be passed to the following command, and the cat command is directly printed, so the tag name will not change.
  • this only means delimiter
  • --all means all files are considered

Or if it has not been pushed to the remote, you can directly delete the local warehouse and pull it from the remote, but all the local data will be lost (っ°Д °;)っ, you can actually choose this method according to the situation ╮(╯-╰)╭

git track files in ignored directories

After the above problem was solved, a new problem appeared. The file larger than 1G is the necessary file for Sphinx-UE4 to recognize Chinese speech. It is in the Content/model directory. Considering that the files in this directory are all files used by the Sphinx-UE4 plug-in, the plug-in itself will not change. There is no need to bring the model directory into the scope of version control, so this directory can be added directly to gitignore. However, there is actually a file that needs to be tracked and it happens to be in the model directory...(⊙_⊙;)..., which is the file used to configure the specific voice mapping mentioned in the previous blog. Plugins can be installed by other members themselves, but more commands will be added in the future. If this configuration needs to be modified by others, the version control system is just a decoration.
Fortunately, the ! symbol can be used in the gitignore file to modify the path to indicate that a file needs to be tracked, so I added the following two lines to gitignore:

/Content/model
!/Content/model/zn/zn.dict

Then you're done!
It doesn't exist, if it were that simple, I wouldn't have recorded it.
The result of these two lines is that the model directory is completely ignored, and the following line has no effect at all.
After google, I found an explanation: because the zn directory has been ignored, git cannot find the zn.dict file, so it cannot be tracked.
The correct spelling is as follows:

/Content/model/*
!/Content/model/zn
/Content/model/zn/*
!/Content/model/zn/zn.dict

That is, to specify each directory that needs to be tracked, layer by layer.
It can be imagined that if the directory tree is deep, this will require writing a lot of lines. From this point of view, git is still inconvenient. Before gitignore has a simpler syntax, it can only be alleviated by rationally planning the directory structure.

new task

Since there is almost nothing that can be changed in terms of voice based on the Sphinx-UE4 plug-in, the rest is to increase or decrease commands and adjust tolerance according to the specific usage, so my part of the work is completed, and then I will We will build specific levels, connect with the DTW algorithms made by other students, and implement a training mode.

Guess you like

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