About this board


Lectrician1 (talkcontribs)

@AKlapper (WMF) I've change this page to just describe how to use Git to interact with Gerrit. It doesn't describe anything else about Gerrit. That has been moved to other pages such as Gerrit/Web tutorial.

AKlapper (WMF) (talkcontribs)

@Lectrician1 ...which makes it Gerrit specific, due to URLs like "", and due to workflows like "git review".

Lectrician1 (talkcontribs)

Okay, but by naming this the main "Gerrit tutorial" it makes it seem as if Git is the only way you use Gerrit. You can also use Gerrit using the web interface. That's why I suggested changing it to "Git tutorial" to differentiate it.

AKlapper (WMF) (talkcontribs)

Git is the only way to use Gerrit (on a server) as Gerrit does not work without Git repositories behind it, but I assume you refer to installing a Git client on your machine from a user perspective, indeed. The problem is that there are several meanings here, I'm afraid... :-/ And I do not think that many folks use the (quite non-intuitive) web interface, so using git is the more common way I'd think. See also previous discussion and feedback in Topic:X9mxl87i9na7ppu9.

Lectrician1 (talkcontribs)

I think people do use the web interface and it is easy to use. I personally used the web interface to make my first changes because I could get setting up SSH keys to work. It was very challenging. Just recently on the MediaWiki Discord server I saw someone not be able to set up SSH keys and they used the web interface instead. That's why I think it's important to show users that the web interface is an available option for them to use.

AKlapper (WMF) (talkcontribs)

The web interface is a nice alternative, indeed.

Reply to "Git Gerrit tutorial"

Simplifying or replacing the Gerrit setup for being a blocker to new developers

Prototyperspective (talkcontribs)

The Gerrit setup process seems to be the main blocker inhibiting newcomers to help with development (once they managed to actively reach this page).

Are there any ongoing projects or issues or debate about either simplifying the process or replacing it?

For example by just using Visual Studio Code and git without Gerrit and/or a GUI that takes the user through a simple step-by-step process to download, install and configure everything that's needed? Using that GUI would not require technical expertise or much time and it would automatically solve/prevent any problems. It (e.g. a Qt one) could also get developed further to also set up other things needed for various WP development projects like the MediaWiki docker container etc. (note that it needs to internally do things like comparing hashsums which it could display)

I think the Gerrit requirements are the or one of the major technical(!) bottlenecks that cause the lack of developers (even though the technical aspects are not even half of the problem). If this hasn't been discussed so far which would be the best places to propose this?

AKlapper (WMF) (talkcontribs)
Prototyperspective (talkcontribs)

Thanks, yes it only seems to be the main blocker to me. Other obstacles once they managed to actively reach this page(!) are probably further down so less inhibitive because by then they already got started developing. GitLab would make things much easier (a GUI could be still be useful for the same reasons once GitLab is being used).

MarMi wiki (talkcontribs)

There should also be (shorter?) tutorial for people that don't want to install anything (want to edit by web, if it's possible).

And alternative way to request for smaller changes (why do I need to create an account to propose a change that has only few lines?).

AKlapper (WMF) (talkcontribs)
Reply to "Simplifying or replacing the Gerrit setup for being a blocker to new developers"

Branch seemed to have changed from master to main

Eugene233 (talkcontribs)

After cloning a repository, I realized that the remote branch changed to main. This however is not reflected in this documentation (Gerrit tutorial). Could this be modified now or should one created a Phabricator ticket for this modification.

AKlapper (WMF) (talkcontribs)

Hi, which "a repository" is this about?

BDavis (WMF) (talkcontribs)
Eugene233 (talkcontribs)

@AKlapper (WMF) I was cloning the commons-recon-service from gerrit. I just noticed that the gerrit tutorial still makes use of the origin master which I was thinking should be origin main(not so sure I had to change to reflect the changes in the origin branch name).

For example in Gerrit/Tutorial#Create a branch changing git checkout -b BRANCHNAME origin/master

to git checkout -b BRANCHNAME origin/main

@BDavis (WMF) Thanks a lot for pointing out the inclusive language page.

AKlapper (WMF) (talkcontribs)
Reply to "Branch seemed to have changed from master to main"
আফতাবুজ্জামান (talkcontribs)

@AKlapper (WMF) I think Gerrit/Tutorial#Editing via the web-interface section needs updating.

8. "Under "Files", click the "Edit" button", if i'm not wrong it should be "In the upper right corner, click the "Edit" button".

9. "Under "Files", click "Add", there is no "add" button but ADD/OPEN/UPLOAD button.

AKlapper (WMF) (talkcontribs)
Reply to "Update"

Got an error while trying to clont pywikibot

PythonSwarm (talkcontribs)

git clone ssh://

Cloning into 'core'...

Connection to closed by remote host.

fatal: the remote end hung up upon initial contact

This happened with all other Gerrit stuff, and cloning from Phabricator and Github is fine.

AKlapper (WMF) (talkcontribs)
Reply to "Got an error while trying to clont pywikibot"

Forgot to branch master and then committed to gerrit

Summary by Tinss

Change the topic flag within gerrit's web UI.

Tinss (talkcontribs)

I absentmindedly forgot to branch master and then committed my change to gerrit. I know it's not the way things are supposed to be done, but do I need to abandon my change on gerrit and redo it?

Samwilson (talkcontribs)

You could rename the current branch (git branch -m new-name) and then review as normal. Or you could use the -t flag for git-review, and explicitly set the topic (git review -t new-name). I normally do the former in that situation. If later you do want a local master branch, you can just create it then (git checkout -b master gerrit/master).

Or there's probably another more correct way that I'm forgetting. :-) That's usually the case with Git.

Oh, sorry, I just realised: do you mean you've already pushed the change for review? In that case the topic flag is the way to go I think, or you can just change the topic via the web UI.

Tinss (talkcontribs)

Yes it's been pushed for review. I've set the topic flag in gerrit. Thanks!

"Network unreachable" message when making ssh connection to Gerrit

Asrajmane193 (talkcontribs)

Hello, I have started with the initial set up. I have everything upto adding ssh key to use with git.

I am running the command to make ssh connection to Gerrit: ssh -p 29418

It gives me the message "ssh: connect to host port 29418: Network is unreachable". I tried changing the port to some random number, 29000. Still no luck.

I am fairly new here. Please help.

Florianschmidtwelzow (talkcontribs)

Can you try to ping What is the result? (i assume you're using a linux distro?)

Xqt (talkcontribs)

29418 is the right port. Maybe it is blocked by a local router or firewall?

Shrutika719 (talkcontribs)

Is this problem resolved? Because I am still facing this problem, I tried switching the ports but all in vain

Darthbhyrava (talkcontribs)

I am facing a similar problem. I think it's the proxy. But even after I installed corkscrew, shifted the installed binary to /bin and made appropriate changes to .ssh/config, I get the same error.

The ping to gerrit is fine, btw.

Any leads?

Edit: Resolved.

There was an error in the path to my corkscrew binary in .ssh/config. I corrected it, added my public keys to gerrit, and it worked. :)

This post was hidden by AKlapper (WMF) (history)

Can't set up SSH keys

Guycn2 (talkcontribs)

I have installed Git from this link and set my username and email.

When I type ls ~/.ssh in the command line, I get the following message:

'ls' is not recognized as an internal or external command, operable program or batch file.

What have I done wrong?

KTC (talkcontribs)

Use the Git Bash shell, not Windows Command Prompt.

Guycn2 (talkcontribs)

Thank you @KTC, I succeeded, but now I encounter another problem: I can't install git-review. When I run Git Bash as administrator and run the following command: pip install git-review, I get an error message saying:

bash: pip: command not found

I ran this command after I had installed Python 3.6, but it still doesn't work...

KTC (talkcontribs)

Try "python -m pip ..." or "python3.6 -m pip ...".

Guycn2 (talkcontribs)

@KTC, I still get this error: "bash: python: command not found".

Is it possible to submit Gerrit patches without installing git-review?

KTC (talkcontribs)

If you can't even run python despite having it installed, then something's not set up right in your environment.

Guycn2 (talkcontribs)

My Python is installed in the following directory: C:/Users/Guy/AppData/Local/Programs/Python/Python36-32

Maybe it has something to do with it?

Reply to "Can't set up SSH keys"
Nikerabbit (talkcontribs)
Qgil-WMF (talkcontribs)

Whats with those "quotes from the community"?

Sophivorus (talkcontribs)

They're hardly useful, I feel they shouldn't be there. Anyone objects to their removal?

Qgil-WMF (talkcontribs)
Return to "Gerrit/Tutorial" page.