Cara Cara

untung99.homes: GerritTutorial MediaWiki


Untung99 menawarkan beragam permainan yang menarik, termasuk slot online, poker, roulette, blackjack, dan taruhan olahraga langsung. Dengan koleksi permainan yang lengkap dan terus diperbarui, pemain memiliki banyak pilihan untuk menjaga kegembiraan mereka. Selain itu, Untung99 juga menyediakan bonus dan promosi menarik yang meningkatkan peluang kemenangan dan memberikan nilai tambah kepada pemain.

Berikut adalah artikel atau berita tentang Harian untung99.homes dengan judul untung99.homes: GerritTutorial MediaWiki yang telah tayang di untung99.homes terimakasih telah menyimak. Bila ada masukan atau komplain mengenai artikel berikut silahkan hubungi email kami di koresponden@untung99.homes, Terimakasih.

This is a tutorial which explains how to use Git to create and modify changes in Gerrit.

  • If you want to save time and are tech-savvy, use the very short how-to guide instead: Gerrit/Tutorial/tl;dr
  • For power users, Gerrit/Advanced usage has additional documentation.
  • If you only want to play with Gerrit and do not want to write a patch for a “real” Wikimedia software project, use our Gerrit test instance instead.

In this tutorial, commands to enter start with a dollar sign in a box, like this: command.
Do not enter the $ prefix.
If a command also includes a variable which you must change yourself, then the variable is shown in red: command variable.

Git is a free and open source distributed version control system.
“Distributed” means that there is no central copy of the repository.
With Git, once you’ve cloned the repository, you have a fully functioning copy of the source code, with all the branches and tagged releases at your disposal.

If you do not have a Wikimedia developer account yet, go to wikitech.wikimedia.org and create an account.
The same username and password will be used to log into Gerrit below.

These instructions explain how to install Git as a command-line (terminal window) tool.
If you prefer a graphical user interface (GUI) instead of the command line, then check the list of clients maintained by the Git project.
For alternate installation instructions see the official documentation.

Installation

Follow Installing Git to learn how to install git on your operating system.

Configure Git

Now that you have Git installed, it’s time to configure your personal information.
You should have to do this only once.
You can also change your personal information at any time by running these commands again.

Git tracks who makes each commit by checking the user’s name and email.
In addition, this info is used to associate your commits with your Gerrit account.

Enter the two commands below to set your username and email address.
Replace gerrituser with your own Gerrit username and replace gerrituser@example.com with your own email address:

git config --global user.email "gerrituser@example.com"

git config --global user.name "gerrituser"

To see your current configuration variables which control how Git behaves, use git config -l.

Set Up SSH Keys in Gerrit

We use an SSH key to establish a secure connection between your computer and Gerrit.
The Wikimedia Security Team recommends, as of August 2021, that users creating SSH Keys use the ed25519 type for optimum security and performance.

Get your SSH key

Follow SSH keys#Generating a new SSH key.

Add SSH Public key to your Gerrit account

  • Log into the web interface for Gerrit. The username and password for your Gerrit are the same as for your Wikimedia Developer account.
  • Click on your username in the top right corner, then choose “Settings”.
  • Click “SSH Keys” in the menu on the left.
  • Paste your SSH Public Key into the corresponding field and click “ADD NEW SSH KEY”.

Test Gerrit SSH connection

Connect to the Gerrit server via ssh to check if everything works as expected.
Replace gerrituser by your shell username as shown in your Gerrit settings:

ssh -p 29418 gerrituser@gerrit.wikimedia.org
  • Be mindful and compare that the “ed25519 key fingerprint” is the same as the SSH fingerprint for gerrit.wikimedia.org:29418. If it is the same, answer “Yes” to “Are you sure you want to continue connecting?”. Then enter the passphrase for your key.
  • You should get a message “Welcome to Gerrit Code Review”. The last line should show “Connection to gerrit.wikimedia.org closed.”
  • If you run into problems, use ssh -p 29418 -v gerrituser@gerrit.wikimedia.org (replace gerrituser by your username). The -v will provide verbose output to help find problems. Then read Gerrit Troubleshooting.

An example Gerrit SSH connection success message looks like this:

gerrituser@machine:/mw/sandbox$ ssh -p 29418 gerrituser@gerrit.wikimedia.org
The authenticity of host '[gerrit.wikimedia.org]:29418 ([208.80.154.85]:29418)' can't be established.
ed25519 key fingerprint is dc:e9:68:7b:99:1b:27:d0:f9:fd:ce:6a:2e:bf:92:e1.
Are you sure you want to continue connecting (yes/no)? yes
Warning permanently added '[gerrit.wikimedia.org]:29418 ([208.80.154.85]:29418)' (ed25519) to the list of known hosts.
Enter passphrase for key '/home/gerrituser/.ssh/id_ed25519':

  ****    Welcome to Gerrit Code Review    ****

  Hi gerrituser, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://gerrituser@gerrit.wikimedia.org:29418/REPOSITORY_NAME.git

Connection to gerrit.wikimedia.org closed.

gerrituser@machine:/mw/sandbox$

Download code using Git

Sandbox

If you would like to practice using Gerrit you can download (also called “cloning”) the repository this tutorial uses called “sandbox”.

Run the following on the Git Bash command line:

git clone ssh://gerrituser@gerrit.wikimedia.org:29418/sandbox
(Replace gerrituser by your Gerrit username.
And make sure the URL begins with ssh: and not https:).

This will copy the entire history and the code base of the “sandbox” extension repository into your machine.
You will have a working directory of the extension’s main branch (usually also called “git master”).
Enter the new directory (via the command cd sandbox).
Now you can look at the code and start editing it.

Existing repositories

Cloning the Sandbox repository will not give you a development environment setup or a running MediaWiki installation.
(Running will require MediaWiki Core and placing the code you checked out in a location expected by your web server.)
See Download from Git for how to download MediaWiki Core, extensions, skins, or any other project repository hosted at gerrit.wikimedia.org from Git.

Vagrant

If you have downloaded MediaWiki or extensions using Vagrant, make sure you have configured Git to push code using SSH instead of HTTPS.

Prepare to work with Gerrit

Gerrit requires that your commit message must have a “change ID”.
They look like Change-Id: Ibd3be19ed1a23c8638144b4a1d32f544ca1b5f97 starting with an I (capital i).
Each time you amend a commit to improve an existing patch in Gerrit, this change ID stays the same, so Gerrit understands it as a new “patch set” to address the same code change.

There’s a git add-on called git-review that adds a Change-ID line to your commits.
Using git-review is recommended.
It makes it easier to configure your Git clone, to submit a change or to fetch an existing one.

Installing git-review

Note that Wikimedia Gerrit requires git-review version 1.27 or later.

For more details, please see Gerrit/git-review#Installation.