I am working with Gerrit and when I push a commit, I use the syntax git push origin master:/refs/for/master
I would like to configure Git to automatically push my current branch to refs/for/master if my current branch is master. My claim is to be able to keep using git push to push to Gerrit review server instead of Git server.
My config file
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = git@GitServer:/myrepo
[branch "master"]
        remote = origin
        merge = refs/head/master
[url "ssh://user@GerritServer:29418/myrepo.git"]
  pushInsteadOf = git@GitServer:/myrepo
Note: The git repository is not handled by Gerrit, this is why I used the option pushInsteadOf to push to Gerrit server.
 
     
    