当我运行 git status 时,*.m.swp文件显示在“ untracked list”中,因为我当前在 MacVim 中打开了这些文件(原始文件是带有*.m文件扩展名的 MATLAB 文件)。
我尝试将*.m.swp及其各种排列添加到我的.gitignore文件中,以便忽略这些文件,但似乎没有任何效果对我有用。
请参阅下面的 git status 输出示例:
git status
# On branch mybranch1
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: ../dir1/file1.m
# new file: file2.m
# new file: file3.m
# modified: file4.m
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../../dir2/.file5.m.swp
# ../dir1/.file6.m.swp
# …Run Code Online (Sandbox Code Playgroud) gitignore ×1