I have two branches, master and dev. I always work on dev and only check code into the master branch once it\'s been approved for production use. When I do so, I have to do
Your best bet would be to just use an alias, placed in your global gitconfig (~/.gitconfig):
~/.gitconfig
[alias] merge-to = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f"
so that you can invoke it from any repository as
git merge-to master dev