最近在使用git时遇到一个问题, push到远程机器上时某个log文件夹丢失了,本地查找是有的,git status也显示clean:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
于是猜测可能是被.gitignore过滤了,打开之后果然,里面有一行:
log/
这一行本来是用来过滤当前目录的的log文件夹,结果其他地方的log文件夹也被过滤了,解决: 指明当前文件夹,改为:
/log
此时在git status就发现那个我想加入git的log文件夹出现了
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/sysu/newchain/consensus/pbft/msg/log/
no changes added to commit (use "git add" and/or "git commit -a")
原文地址:https://cloud.tencent.com/developer/article/2028454
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。