gitignore of moodle files

gitignore of moodle files

by Joanna Beaver -
Number of replies: 2
Picture of Plugin developers

Hello

I have a repo and would like to not commit any of the core moodle files, but do want to commit things that I add. These things may be at same level in directory structure (i.e. local or themes) so I cannot link repo to one plugin folder as such.

My directory structure is

moodle39
├── moodle
├── moodledata
├── .gitignore

I have done git init on moodle39.

Into gitignore I have added

/moodle/*
!/moodle/local
!/moodle/local/mypluginname

The problem is my gitignore is working a little too well and no changes I make in local/mypluginname are being found. After git add --all it just says

modified: moodle (modified content, untracked content)

Do I have the syntax in the .gitignore wrong?

Best wishes

Jo

Average of ratings: -
In reply to Joanna Beaver

Re: gitignore of moodle files

by Joanna Beaver -
Picture of Plugin developers
I have just realised that to get my moodle files I did git clone into the moodle39/moodle directory. And then I am doing git init on moodle39 and linking to a different repo. Could it be this that is confusing it?
In reply to Joanna Beaver

Re: gitignore of moodle files

by Joanna Beaver -
Picture of Plugin developers
Rubber chickened myself. It is now working. Not entirely sure how - I removed .git from the moodle directory, deleted then reinitialised the moodle39 repo, changed my gitignore code to this
/moodle/*
/moodle/local/*
!/moodle/local
!/moodle/local/mypluginname
and it works!
so one or all of those things is good. Most probably the last one

Best wishes

Jo
Average of ratings: Useful (1)