How can I ignore directories or folders in Git using msysgit on Windows?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 请教Git如何克隆本地库?
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
Also in your
\.git\info
projects directory there is an exclude file that is effectively the same thing as.gitignore
(I think). You can add files and directories to ignore in that.I had some issues creating a file in windows explorer with a . at the beginning.
a workaround was to go into the commandshell and create a new file using "edit"
To ignore an entire directory in git, the easiest way is to include a .gitignore file within the target directory which simply contains "*"
An illustrative example,
Example System
Goal
Top Level .gitignore (/root/.gitignore)
Ignored Directory .gitignore (/root/dirB.gitignore)
and it's that simple :)
I've had some problems getting git to pickup the .gitignore file on Windows. The $GIT_DIR/info/exclude file always seems to work though. The downside of this approach, however, is that the files in the $GIT_DIR directory are not included in the check-in, and therefore not shared.
( p.s. $GIT_DIR is usually the hidden folder named .git )
On windows and Mac, if you want to ignore a folder named Flower_Data_Folder in the current directory, you can do:
If its a file named data.txt
if its a path like "Data/passwords.txt"