Pushing patches to gerrit over https
This post was originally posted on October 29, 2014 on blog.aaronorosen.com
I’ve been doing a good amount of traveling lately and have unfortunately found myself on several networks that only allow outbound http(s) and dns traffic. This makes it a little tricky to push patches to gerrit (or review.openstack.org) unless you’re able to do it over http(s). Luckily enough gerrit supports this! To do this first stage the commits you want to push like you’d normally do. Then, navigate to gerrit -> settings -> HTTP Password tab which should look like this:

Next, push you’re commit(s) with the following command:
$ git push https://review.openstack.org/<path-to-repo> HEAD:refs/for/<branch>
For example:
$ git push https://review.openstack.org/stackforge/python-congressclient HEAD:refs/for/master
Username for 'https://review.openstack.org': arosen
Password for 'https://arosen@review.openstack.org':
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 429 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote: https://review.openstack.org/131669
remote:
To https://review.openstack.org/stackforge/python-congressclient
* [new branch] HEAD -> refs/for/master
One important security note: you want to use https here otherwise it will send your password in clear text over the wire. If you do this by mistake gerrit lets you easily generate a new password by clicking the generate password button. Hopefully someone finds this helpful!