BentCoder
BentCoder

Reputation: 12740

Global .gitignore within vagrant

Steps below work fine when I want to ignore a file globally in Linux however when I SSH into vagrant and run git status I can still see .idea/ as "Untracked". What should I do in order to help vagrant picking up these global settings?

I placed .idea/ in .gitignore file as created below.

bc@bc:~$ sudo nano .gitignore
bc@bc:~$ git config --global core.excludesfile /home/bc/.gitignore

Upvotes: 3

Views: 1034

Answers (1)

VonC
VonC

Reputation: 1328982

The issue is where git will look for the global config in the ssh session: it will be in /home/vagrant.

Hence the solution (initially detailed by inanzzz):

vagrant@mydev:/vagrant$ sudo nano /home/vagrant/.gitignore_global

Place an .idea/ line in the file then save/exit.

vagrant@mydev:/vagrant$ git config --global core.excludesfile /home/vagrant/.gitignore_global

Upvotes: 3

Related Questions