4

I'm developing a Joomla! component named com_proposta.

I'm using git for version control. I want git to ignore all Joomla files except the files in administrator/components/com_proposta and components/com_proposta.

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
user2671169
  • 203
  • 1
  • 10
  • A similar question was already answered here: [git: ignore everything except subdirectory](http://stackoverflow.com/questions/1248570/git-ignore-everything-except-subdirectory) – JimiLoe Jul 12 '15 at 10:18

3 Answers3

2

There is actually a gitignore file on git that you can use (and contribute to).

https://github.com/github/gitignore/blob/master/Joomla.gitignore

Søren Beck Jensen
  • 1,676
  • 1
  • 12
  • 22
1

You can use the ! operator to negate ignoring in .gitignore. In your case:

* 
!administrator/components/com_proposta
!components/com_proposta
Mureinik
  • 297,002
  • 52
  • 306
  • 350
0

This works better. We need to provide details for each directory what to include and what to exclude.

administrator/cache/*
administrator/components/*
administrator/help/*
administrator/includes/*
administrator/language/*
administrator/logs/*
administrator/manifests/*
administrator/modules/*
administrator/templates/*
!administrator/components/com_compname

bin/*
cache/*
cli/*
components/*
images/*
includes/*
language/*
layouts/*
libraries/*
media/*
modules/*
plugins/*
templates/*
tmp/*

!components/com_compname

configuration.php
htaccess.txt
index.php
LICENSE.txt
README.txt
robots.txt
web.config.txt
Sasi varna kumar
  • 193
  • 1
  • 2
  • 11