MyBB Community Forums

Full Version: Help with how to handle the Git repository
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Disclaimer: I 'm a fairly basic user of Git, and I use it mainly for local development.

I'm trying to find a repository structure to be able to fetch updates from github and maintain my custom changes into another branch.

However on my Ubuntu VM, it seems php has trouble writing to inc/settings.php unless I use chmod 777 (which is actually recommended by the error message when I save the configuration in MyBB).

And when I chmod 777... then .gitignore no longer works and keep pestering me about committing inc/settings.php

And of course I can't do that otherwise it'll mess with my board settings when I switch branches, AND then it keeps bugging me about the file even though it is meant to be ignored, since I've added it to the history.

So what did I do wrong? Could you help me figure the proper repository structure?

Here's  what I did:

git clone https://github.com/mybb/mybb.git

This pulls the feature branch, for some reason I do not get the master as well

So I figured, let's just branch off from the last release, so I have a "master" branch that is at the last stable release 1.8.6 :

git co -b stable mybb_1806

Alright so I have 1.8.6. Now I can branch again to keep my edits in a new branch develop:


git co -b develop



Unfortunately, inc/settings.php has permissions rw-rw-r--  and for whatever reasons MyBB can not update it. And if I set it to 777, then git considers the file is staged, even though .gitignore is set to ignore it.

How can I solve this? Huh

I haven't made many custom edits yet so if you think my git repository structure is bad I can change it, thanks!

I did this and that doesn't work after I edit the board configuration (git wants to add inc/settings.php)

git config core.filemode false

So it seems permissions is not the problem. I think the problem is inc/settings.php was committed earlier in the history and git doesn't ignore it as it should.

How do MyBB developers handle this?

Nevermind, since I am not contributing with this repository and there aren't that many updates, I don't think I need to work with the full mybb history.

I will make a new git repo based on the download archive.
Sorry to say nobody knows yet and i'm also following this thread