I'd like to have Git ignore all hidden files and directories, i.e. .aptitude
, .ssh/
and .bash_rc
. Is there a simple rule to cover this without specifically adding each entry?
相关问题
- 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
Just add a pattern to
.gitignore
Edit: Added the
.gitignore
file itself (matters if it is not yet commited)..gitignore will only effect files that haven't been 'added' already.
To make new .gitignore entries affect all files
git commit -a -m "Pre .gitignore changes"
git rm -r --cached .
git add .
git commit -a -m "Post .gitignore changes"
git status
should output "nothing to commit (working directory clean)" `In
.git/info/exclude
, add this line:This will make ignoring all hidden/dot files recursively the default for every repository on the machine. A separate
.gitignore
file for every repo is not needed this way.