Does the .gitignore file belong in the .git folder structure somewhere or in the main source files?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
As the other answers stated, you can place
.gitignore
within any directory in a Git repository. However, if you need to have a private version of.gitignore
, you can add the rules to.git/info/exclude
file.When in doubt just place it in the root of your repository. See https://help.github.com/articles/ignoring-files/ for more information.
Put .gitignore in the working directory. It doesn't work if you put it in the .git (repository) directory.
Also, if you create a new account on Github you will have the option to add .gitignore and it will be setup automatically on the right/standard location of your working place. You don't have to add anything in there at the begin, just alter the contents any time you want.
You can place .gitignore in any directory in git.
It's commonly used as a placeholder file in folders, since folders aren't usually tracked by git.
If you want to do it globally, you can use the default path git will search for. just place it inside a file named "ignore" in the path "~/.config/git"
(so full path for your file is: ~/.config/git/ignore)