Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| gerrit_tutorial [2020/04/21 17:31] – rpjday | gerrit_tutorial [2020/04/21 17:55] (current) – [git-review --setup] rpjday | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| * Create account at Mediawiki, add SSH keys | * Create account at Mediawiki, add SSH keys | ||
| * Install '' | * Install '' | ||
| + | |||
| + | Test access with (should see): | ||
| + | |||
| + | < | ||
| + | $ ssh -p 29418 rpjday@gerrit.wikimedia.org | ||
| + | |||
| + | **** Welcome to Gerrit Code Review | ||
| + | |||
| + | Hi Robert P. J. Day, you have successfully connected over SSH. | ||
| + | |||
| + | Unfortunately, | ||
| + | To clone a hosted Git repository, use: | ||
| + | |||
| + | git clone ssh:// | ||
| + | |||
| + | Connection to gerrit.wikimedia.org closed. | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Cloning the test repo ===== | ||
| + | |||
| + | Clone a test repo: | ||
| + | |||
| + | < | ||
| + | $ git clone ssh:// | ||
| + | Cloning into ' | ||
| + | remote: Counting objects: 44, done | ||
| + | remote: Finding sources: 100% (4/4) | ||
| + | remote: Getting sizes: 100% (3/3) | ||
| + | remote: Compressing objects: 100% (127443/ | ||
| + | remote: Total 1342 (delta 0), reused 1339 (delta 0) | ||
| + | Receiving objects: 100% (1342/ | ||
| + | Resolving deltas: 100% (889/889), done. | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | The '' | ||
| + | |||
| + | < | ||
| + | [core] | ||
| + | repositoryformatversion = 0 | ||
| + | filemode = true | ||
| + | bare = false | ||
| + | logallrefupdates = true | ||
| + | [remote " | ||
| + | url = ssh:// | ||
| + | fetch = +refs/ | ||
| + | [branch " | ||
| + | remote = origin | ||
| + | merge = refs/ | ||
| + | </ | ||
| + | |||
| + | The '' | ||
| + | |||
| + | < | ||
| + | [gerrit] | ||
| + | host=gerrit.wikimedia.org | ||
| + | port=29418 | ||
| + | project=mediawiki/ | ||
| + | track=1 | ||
| + | </ | ||
| + | |||
| + | Finally, there are no configured hooks: | ||
| + | |||
| + | < | ||
| + | $ ls -1 .git/hooks | ||
| + | applypatch-msg.sample | ||
| + | commit-msg.sample | ||
| + | fsmonitor-watchman.sample | ||
| + | post-update.sample | ||
| + | pre-applypatch.sample | ||
| + | pre-commit.sample | ||
| + | pre-merge-commit.sample | ||
| + | prepare-commit-msg.sample | ||
| + | pre-push.sample | ||
| + | pre-rebase.sample | ||
| + | pre-receive.sample | ||
| + | update.sample | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Configuring git-review ===== | ||
| + | |||
| + | Verify remotes: | ||
| + | |||
| + | < | ||
| + | $ git remote -v | ||
| + | origin ssh:// | ||
| + | origin ssh:// | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ==== Configuring git-review for origin ==== | ||
| + | |||
| + | Point '' | ||
| + | |||
| + | < | ||
| + | $ git config --global gitreview.remote origin | ||
| + | </ | ||
| + | |||
| + | Adds .gitconfig info: | ||
| + | |||
| + | < | ||
| + | gitreview.remote=origin | ||
| + | </ | ||
| + | |||
| + | ===== git-review --setup ===== | ||
| + | |||
| + | Set up '' | ||
| + | |||
| + | < | ||
| + | $ git review -s | ||
| + | </ | ||
| + | |||
| + | which does the following: | ||
| + | |||
| + | * check remote access for submitting branches (if no remote access, ask for username) | ||
| + | * create remote access called " | ||
| + | * install Gerrit '' | ||
| + | |||
| + | |||