2

In my research I found that there seems to be no "single source of truth" for where to post MediaWiki questions. MediaWiki questions have been posted on these many Stack Exchange network subdomains:

ProWebmasters, Security, Web Applications, Software Recommendations, (and probably others).

So, I'm taking a shot and posting my question here, because the question is about hosting mediawiki sites and software best practices.

MY Question

1a) What is considered best practice in 2021 for how to put a mediawiki site under Git version control? I tried CD into mediawiki folder and type git init. But, it gives me umpteen warnings about CRLF line endings. I understand that it has to do with auto converting from Linux line endings to Windows and vice versa. I chose to set autocrlf to true, as is recommended by many sources.

But, then I just get all these warning messages. So, I found a video on how to suppress the warning messages with .gitattributes file, which worked, but __it didn't shorten the length of time to finish git add of all the files and folders in MediaWiki. At present, I have deleted the .gitattributes file since I at least now I will know that Git is still processing (by the warning messages) and not just stuck or hung on a process.

1b) After deleting the .gitattributes file the git add process seemed to finish even quicker! Upon completion of git add, I see all these "create mode 100644" messages. I don't know if I should be worried about them or not. What does create mode 100644 mean and should I be worried about that at all?

Create Mode 100644 messages from git add

1c) The last part of my question is simply this. If I were to say I was going to put 100 GB of video and zip files under git source control many of you would rightly advise "Don't do it, bro!", because although you can do it, it is not a good idea. Based on how long it took just to do the git add command, I'm wondering if putting mediawiki under git is even a good idea. I want to edit files in my mediawiki install, track the edits, be able to revert them when necessary, experiment on other branches, etc.Therefore,

Is it even recommended or not a good idea to put installations of framework-based websites like MediaWiki, WordPress, etc. under git source control? Or are the perhaps special considerations that one must know to do it safely/correctly/best-practice-ly?

3
  • I don't have references at hand (and they are probably not welcome there) but I am pretty sure/I know there are CMS/wiki systems built on top of git. If you need git absolutely, it would probably make sense to explore those cases first, instead of trying to shoehorn git into something that was not designed for it. Nov 30 '21 at 16:41
  • @PatrickMevzek Can you explain what you mean? Nov 30 '21 at 16:53
  • A CMS or a wiki can be seen as a piece of software recording changes on "something" (pages). The software can just keep the latest version (when edits are done) and hence does not need history, or it can decide to keep all versions (and publish only the latest one). By keeping all versions you gain new features like being able to see differences that happened and when. Then you have the question of where and how you store all those versions of a single page. It could be in a database for example... or it could be in git. A wiki page can be just a one Markdown file, something git can handle. Dec 1 '21 at 6:05
1

Neither MediaWiki nor WordPress lend themselves to having an entire site put under git version control. There are several reasons for this:

  1. Sites often have large amounts of uploaded binary image files. Git is best at tracking text changes and won't do a good job as a store for images.
  2. The text content of these sites is stored in a database. The database uses a binary format to store all its data. So even the text content of these sites is not readily able to be managed by git. At best you would have to dump the database to SQL to commit it to git.
  3. Changes to the sites can be made directly on the site itself and the site software has no hooks to check these changes into git. Git version control works best when everything that modifies the content knows to check changes into git.
  4. The code that powers sites is usually installed from a downloaded zip file rather than from git. You would also have to download code updates and check them into git.

It isn't clear what you would gain by checking these entire sites into git. MediaWiki has change tracking for edits built into it already, so you shouldn't need git to show you history of each page. Both MediaWiki and WordPress can be (and should be) backed up without using git.

If you are making changes to code that powers a site, it would make sense to use git for that code. For example if you were developing a WordPress theme you would want to check your theme into git, but you wouldn't want to check your entire site into git.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.