2017-03-07 1 views
2

Mon fichier ~/.config/git/ignore comprend:Pourquoi mon fichier git ignore le fichier xcuserdata?

xcuserdata/** 

Je viens de vérifier un nouveau projet de Bitbucket, a ouvert dans Xcode, et a couru git status, et il montre:

Untracked files: 
    (use "git add <file>..." to include in what will be committed) 

    Project Name.xcodeproj/project.xcworkspace/xcuserdata/ 

Pourquoi ne pas l'ignorer fichier correspondant à ce répertoire?

Répondre

1

Tout d'abord si vous voulez exclure un dossier, vous n'avez pas besoin '**'

# The trailing slash is enough 
xcuserdata/ 

En second lieu, vérifier si $XDG_CONFIG_HOME est réglé.
Le chemin par défaut pour un gitignore global est en effet (si $XDG_CONFIG_HOME est soit pas défini ou vide) $HOME/.config/git/ignore

Si rien ne fonctionne, situé directement à travers:

git config --global core.excludesFile /path/to/global/ignore/file 

Après discussion, le OP Vaddadi Kartick a enlever .git/info/exclude (qui avait un xcuserdata, sans slash).
Vaddadi a gardé ~/.config/git/ignore avec xcuserdata/, et le statut ignore maintenant ce dossier.

+0

$ XDG_CONFIG_HOME n'est pas défini et xcuserdata s'affiche toujours en tant que fichier non suivi. Comment puis-je réparer ça? –

+0

@VaddadiKartick avez-vous un fichier suivi dans 'xcuserdata'? Essayez un 'git rm --cached" Appareil photo flashé.xcodeproj/project.xcworkspace/xcuserdata/"' – VonC

+0

Il est dit: fatal: pathspec ne correspond à aucun fichier. J'ai confirmé sur l'interface Web de Bitbucket, et xcuserdata n'est pas suivi. –