User:Dan-nl/Git and Gerrit/Troubleshooting

Incorrect remote
When you clone a repository with git, it defaults to using a remote nickname of “origin”, however,  works with a remote nickname of “gerrit”. If you cloned the repository without specifying the remote nickname,, then it will be named “origin” and this will create problems when using the   tool to interact with the wikimedia gerrit server. Below are instructions on how to correct this issue :

View the git remotes available

 * If you see an “origin” entry after entering the above command, then continue with the steps below.

Rename “origin” to “gerrit”

 * If you only saw an entry for “origin” then use the following command, otherwise, continue with Remove the “origin” remote.

Remove the “origin” remote

 * If you saw an entry for both “origin” and “gerrit” then use the following command.

Change the tracking branch for “git pull”

 * In order for “git fetch” and “git pull” to show a helpful message such as the one below:


 * Your branch is behind 'gerrit/master' by 63 commits, and can be fast-forwarded.


 * You need to tell your local branch (for example “master”) to track “gerrit/master” instead of “origin/master”


 * After this you don't need “origin” anymore and you can safely use shortcuts like "git pull" to update your working copy. Unfortunately you must perform these steps for every project checked out, e.g., core and extensions.

Make sure the remote is okay

 * After changes the configuration should look like: