J'ai mon répertoire personnel Git bash sous contrôle de version. J'utilise une liste blanche (ignorer tout sauf ...):Impossible de ne pas ignorer ssh config dans git repo
$ cat .gitignore
# Ignore all the things
*
# But not these (with exceptions)
!*.bash_aliases
!*.bash_profile
!*.bashrc
!*.drush/
!*.drush/*
.drush/cache
!.gitconfig
!.gitignore
!.gitalias
!*.minttyrc
!*.vim/
!*.vim/*
.vim/.netrwhist
!*.vimrc
Je veux ajouter le .ssh/config
des exceptions, mais je ne l'ai pas semblé avoir obtenu la syntaxe correcte.
$ ls .ssh/config
.ssh/config
J'ai cette ligne dans mon .gitignore
:
$ git diff
diff --git a/.gitignore b/.gitignore
index 22b3a79..b84bcd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@
!.gitignore
!.gitalias
!*.minttyrc
+!.ssh/config
!*.vim/
!*.vim/*
.vim/.netrwhist
Cependant, il n'a pas été unignored:
~ (master)
$ git status
Changes not staged for commit:
modified: .gitignore
no changes added to commit (use "git add" and/or "git commit -a")
regardant la syntaxe d'autres choses dans le .gitignore, j'ai essayé ceci:
$ git diff
diff --git a/.gitignore b/.gitignore
index 22b3a79..659d7be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@
!.gitignore
!.gitalias
!*.minttyrc
+!*.ssh/config
!*.vim/
!*.vim/*
.vim/.netrwhist
en vain:
$ git status
Changes not staged for commit:
modified: .gitignore
no changes added to commit (use "git add" and/or "git commit -a")
Quelle est la syntaxe pour ajouter .ssh/config
comme une exception dans .gitignore
?
double possible de [.gitignore exclut le dossier mais inclut un sous-dossier spécifique] (https://stackoverflow.com/questions/5533 050/gitignore-exclude-folder-but-include-spécifique-sous-dossier) – phd