Talk:Download from Git

Jump to navigation Jump to search

About this board

using depth when cloning a tag

Berot3 (talkcontribs)

I couldn't find anything related here.

I wanted to use git to download the 1.35.1 tag but with --depth=1. I think it is workth mentioning on Download from Git#Download a stable branch that (from what I found on google) this is the command:

git clone --branch 1.35.1 --depth=1 mediawiki

so instead of cloning a actual branch, we can use the tag.

How did I get to this you may ask? Well when first doing:

git clone --branch REL1_35 mediawiki --depth=1

and than

git checkout 1.35.1

(as the page suggests) you wont get anywhere, because no tags where downloaded.

Am I missing something? Let me know please.

Berot3 (talkcontribs)

or is it so that --branch REL1_35 already is on tag 1.35.1? But than why should I checkout 1.35.1?

MarkAHershberger (talkcontribs)

Try the following:

git clone -b 1.35.1 --single-branch mediawiki
MarkAHershberger (talkcontribs)

Never mind, it looks like using git to specify a single tag as the branch is the quickest and most light-weight checkout.

Checking out the entire repo and then fetching just that tag takes me about half a minute longer and 40mb more space than just checking out a single branch:

 time (
   git clone &&
   cd core &&
   git checkout 1.35.1
 ) && du -sh core
 user    5m11.114s
 448M    core


 time git clone -b 1.35.1 --single-branch \ &&
 du -sh core
 user    4m40.874s
 407M    core

But your method is fast and cheap.

 time git clone -b 1.35.1 --depth 1 \ &&
 du -sh core
 user    0m2.076s
 174M    core
Berot3 (talkcontribs)

Thanks, but I just googled ;)

Did you maybe see my second question? I’m a bit confused, if just clone the branch, am I already on 1.35.1? If so than I could also clone the branch with depth=1.

MarkAHershberger (talkcontribs)

A branch is not the same as a tag. Commits can be on a branch after the revision tagged 1.35.1. If you want 1.35.1, it is best to directly check it out.

Reply to "using depth when cloning a tag"

Keeping an addendum indicating the change from old standards

Paradox of Thrift (talkcontribs)

I suggest there be an addendum created on this page (and others) indicating when a standard has changed -- links, for example. Doing so would allow users to find this page through a search engine when querying the older style links that are used in a plethora of non-updated examples. This would save others from the repeat of my unproductive experience:

I was following this page: in learning how to add some extensions but got tripped up on the old standard of linking to the code repository:

whereas it is now:

Most older examples accessing the repository incorporate the old standard link which no longer work and do not lead here.

Jdforrester (WMF) (talkcontribs)

We can't really fix other people's outdated sites, sadly. There was quite a lot of noise made at the time of the gerrit upgrade two(?) years ago that /r/p/ links won't work any more. The more banners and warnings you put on these pages, the more readers will ignore them entirely, or miss the important bits.

Reply to "Keeping an addendum indicating the change from old standards"

Problem with 'git submodule update'

Spas.Z.Spasov (talkcontribs)

I'm just trying to downloading all extensions, following this sequence:

git clone
cd extensions
git submodule update --init --recursive

The problem is that some extensions asks for authentication. I've made account in but it is 'Unauthorized' and result is:

$ git submodule update --init --recursive
Cloning into 'Notifications'...
Username for '': Spas.Z.Spasov
Password for '':
remote: Unauthorized
fatal: Authentication failed for ''
fatal: clone of '' into submodule path 'Notifications' failed

(I found that extension '2ColConflict' also make this trouble...)

Could someone help me get through this?

Jaideraf (talkcontribs)

Same problem to me. Notifications asks username and password.

Jaideraf (talkcontribs)

@Spas.Z.Spasov I did

cd extensions/
git submodule foreach 'git checkout -b REL1_28 origin/REL1_28 || :'
git submodule update --init --recursive

And now it works.

Spas.Z.Spasov (talkcontribs)

Thank you! I will try it these days. And will report also.

Why "install-dir" are translatable?

Liuxinyu970226 (talkcontribs)

Are those "translations" of commands really work in Git softwares?

Reply to "Why "install-dir" are translatable?"

Translation: source needs update

Omotecho (talkcontribs)
Reply to "Translation: source needs update"

What external libraries that MediaWiki requires are no longer in this "core" git repository?

Orestn (talkcontribs)

The "Fetch external libraries" section states that "external libraries that MediaWiki requires are no longer in this "core" git repository".

Which libraries are no longer included?

These instructions are given to install these needed libraries "composer install --no-dev". My understanding of composer is that --no-dev tells composer to skip installing packages listed in require-dev. How then would a command that tells composer to skip installing certain packages cause it to install additional required libraries?

Orestn (talkcontribs)

Ah, I hadn't paid attention to the part in the documentation that says "switch to your core directory" before running composer install.

I had been running "composer install" in the project root folder. This folder has a composer.json which requires mediawiki/core.

I see now that there is another composer.json file in the vendor/mediawiki/core folder and that running composer install in this folder brings in additional libraries.

I still don't understand why running composer install at the project root doesn't resolve all dependencies when it installs mediawiki/core.

Legoktm (talkcontribs)

> I had been running "composer install" in the project root folder. This folder has a composer.json which requires mediawiki/core.

What is your project root folder? Where did you get this folder from, and why does it have a composer.json that requires "mediawiki/core"??

Reply to "What external libraries that MediaWiki requires are no longer in this "core" git repository?" (talkcontribs)

I cloned several extensions into .../extensions. Thereafter I tried to be a real smart ass by trying to switch all of them to the 1.23 branch. I did as instructed "git submodule update --init --recursive" followed by "git submodule foreach 'git checkout -b REL1_23 origin/REL1_23 || :" The I run update.php and get the following message: This version of the CharInsert extension requires MediaWiki 1.25+. That's awesome but does not help me since I want to do 1.23. Any hint appreciated. (talkcontribs)

Even if I go to /extensions/CharInsert and do "git checkout -b REL1_23 origin/REL1_23" the update.php script tells me This version of the CharInsert extension requires MediaWiki 1.25+??? (talkcontribs)

I just found out that I messed something with CharInsert while trying to to what is described in my first post. So if I do "git checkout -b REL1_23 origin/REL1_23" in every exension's folder I am cool. So how do I save time and do it for all of them in one go. This will be great. (talkcontribs)

The internet tells me to do something like "git submodule foreach --recursive git checkout -b REL1_23 origin/REL1_23" This does not work either. Still looking for a solution to not having to do it for say 50 extensions ... or is it that git is just a flawed system. There must be a trick I guess. (talkcontribs)

Probably this only works if you download the whole lot of extensions and not an isolated set of say 50. I guess git is funny ha ha Let's do the solos :)

MarkAHershberger (talkcontribs)

It doesn't sound like you used submodules to initially install the extensions, did you? (talkcontribs)

No I did not, but did not realize this in the heat of the action. There should be a note about it.

MarkAHershberger (talkcontribs)

I just used the exact commands you gave and successfully set up gerrit. In fact, I did

   $ cd skins; git submodule foreach git review -s

and had success. Well, it did fail on the WPtouch skin, for some reason, but setting the gerrit remote in that directory manually allowed it to continue.

To set the gerrit remote in that directory:

   $ cd WPTouch; git remote add gerrit URL
Reply to "So how do I ... ????"
Frimelle (talkcontribs)

I was recently installing MediaWiki with someone who did it for the first time. The skins part was what I saw them struggling most with.

I think that's mainly because:

  • It's so late in the manual
  • It doesn't mention anywhere before you'll have to install skins (if it's supposed to stay where it is, it should be mentioned before that the step is necessary)
  • The section itself links to another tutorial, for beginners it would be nicer to have a quick "How to set up the Vector skin and here is a link to how to work with all the other skins if you know what they do already"

I would like to change it in the way suggested but am open for feedback. Therefore I thought I mention it here and see if there are other/opposing opinions.

BDavis (WMF) (talkcontribs)

The proposed changes sound reasonable to me. Many of our docs are written by people with very deep knowledge of how our software is intended to be used. That perspective often leads to docs that very precisely correct but not necessarily easy to follow. Copy editing always welcome! The worst thing that could possibly happen is a revert. :)

Reply to "Download skins section"
Jidanni (talkcontribs)
  • User sees section 'Download for development'.
  • User wants section 'Download not for development'.
  • User researches the advice "git clone --depth 1, then e.g., git pull (--depth=1 too?) monthly".
  • After several years user finds du -sh showing
1.5G    mediawiki/
1.4G    mediawiki/.git
  • User does not need history filling up his disks! (talkcontribs)
Reply to "Download not for development"

Using Git to download MediaWiki skins

Purodha (talkcontribs)

If you want to download all skins for development, one might be tempted to:

       git clone ssh://
       cd skins
       git review -s
       git submodule update --init --recursive

That creates a set of files but they cannot be used to submit amendments. If you try:

       cd <someskin>
       git review -s

you get:

       Problems encountered installing commit-msg hook
       /.../<someskin>/.git/hooks/commit-msg: Not a directory
       protocol error: expected control record

and attempts to use:

       git review ...

so as to submit patches yields similar error messages.

Please document a correct working way to solve the problem.

Reply to "Using Git to download MediaWiki skins"