User:Purodha/git+gerrit

=This page is currently a collection of stuff, not even a draft. Do not use it!=

Get access
Follow the instructions to create a developer account, and wait until you have you git-username and access privileges confirmed. Meanwhile:

Set up your local system
export EDITOR=vim git config --global core.editor "vim"
 * Install and configure.
 * Install.
 * Install.
 * Create an SSH key.
 * Once you got access, in one go log in and add your public key to:
 * ,
 * .
 * Go to your local user shell and tailor your settings:
 * To set your automatically invoked editor to, either of the following commands will do, both are okay, too, depending on your needs. Feel free to choose another editor:
 * next&hellip;

Install  following https://www.mediawiki.org/wiki/Gerrit/Tutorial#Setting_up_Git

and gerrit ?
 * https://www.mediawiki.org/wiki/Gerrit/Tutorial#Setting_up_Git


 * Either of the following two commands will do, both are okay, too, depending on your needs:

export EDITOR=vim git config --global core.editor "vim"

git config --global user.name ' your-git-username ' git config --global user.email ' an-e-mail-adress-of-yours-which-is-also-set-in-gerrit ' git config --global gitreview.remote origin

Check an extension out, amend it, upload your change for review
Find out the extensions name in git+gerrit, e.g. from git clone ssh:// user-name @gerrit.wikimedia.org:29418/mediawiki/extensions/ extension-name .git cd extension-name git review -s git checkout master git pull --rebase git checkout -b "purodha-`~/bin/ymds`" echo " Happy typing!" — cd "$1" git commit --all $* git show HEAD git fetch --all echo " >> now upload changes." git review

Create new branch from current branch
git checkout -b newbranch

Delete branch
git branch -D oldbranch

Last changes of last commit after fresh pull
git diff HEAD^ HEAD

Rebase (committed) patchset
If you do not have uncommitted changes and you are on branch yourbranch : git checkout master git pull git checkout yourbranch git rebase master

Restore file to last commit
git checkout file

Restore all all files to last commit
git reset --hard

Undo the last commit
git reset --hard HEAD~1

Get the newest changes from gerrit in your current branch
cd user-name git checkout target-branch git pull --rebase origin master This may cause merge conflicts.

Review
Since folks are tired of debugging python stacktraces and incorrect git-review configuration, some are recommending to use the underlying Gerrit workflow command:

git push origin HEAD:refs/publish/[/]