这种情况正在发生,我无法理解为什么
User-MBP:Project user$ git status
On branch playlist
Your branch is ahead of 'origin/playlist' by 1 commit.
(use "git push" to publish your local commits)
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: Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
modified: Project/TPSettings.plist
no changes added to commit (use "git add" and/or "git commit -a")
User-MBP:Project user$ cat .gitignore
SubModules/
.DS_Store
Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate
Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
User-MBP:Project user$
Run Code Online (Sandbox Code Playgroud)
该文件是在.gitignore所以它不应该告诉我提交文件.
我尝试了几种不同的组合,但我无法从git中排除mongodb日志.
我的gitignore:
mongodb/data/
mongodb/data/log/mongod.log
mongodb/data/**/*.log
/mongodb/data/**/*.log
Run Code Online (Sandbox Code Playgroud)
他们都没有工作.当我输入
git状态
我仍然得到以下内容:
修改:mongodb/data/log/mongod.log
我怎么能忽略这个文件?mongodb/data/db下的数据被忽略.我不明白为什么日志文件会不断出现.
我有一个 Gemfile.lock,git 根本不会忽略它。它在我的 gitignore 文件中(见下文),但每当我bundle install. 还有其他人遇到过这样的事情吗?提前致谢。
我的 Gitignore 看起来像这样:
/.tags*
/log
/tmp
/db/*.sqlite3
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
Gemfile.lock
...
Run Code Online (Sandbox Code Playgroud) /.idea我想忽略 IDE 中的一个隐藏文件夹。我遵循了https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore的模式,但它并没有被忽略。
// .gitignore
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
package-lock.json
**/node_modules
# testing
/coverage
# production
/build
# Things that I have tried
.idea/
/.idea/
.idea/**
Run Code Online (Sandbox Code Playgroud)
有什么方法可以忽略它?