我是 git 的初学者,正在设置一个初始项目,刚刚创建了一个 .gitignore 文件,我试图推送它,但提交时出错。
我创建了一个远程存储库并将其克隆并完成了一些测试提交/推送/拉取。
现在我刚刚创建了一个 .gitignore 并希望将其推送到远程存储库。如果我执行“git status”,我会得到:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: .gitignore
但是,如果我尝试执行“git commit .gitignore”,我会得到:
E325: ATTENTION
Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"
owned by: Me dated: Mon Mar 25 15:51:27 2013
file name: ~Me/Desktop/MyProject/iOS/.git/COMMIT_EDITMSG
modified: YES
user name: Me host name: Me-MacBook-Pro.local
process ID: 28500
While opening file ".git/COMMIT_EDITMSG"
dated: Mon Mar 25 16:32:44 2013
NEWER than swap file!
为什么会这样,我应该如何进行?