I recently started using magit package in emacs and its really useful and handy. I would like to make couple of tweaks.
How do I make magit pull to be always have rebase option?. Currently it shows up switches and I have to choose -r --rebase. In my dev process, we always rebase.
I use gtags+global for code browsing. Upon magit pull, It would be great if I can have a hook to rebuild the gtags again. Is there hook after git pull success ?.
I do not know any Magit-specific setting, but you can just configure
gititself accordingly:I'd strictly advise against on enabling this setting globally.
As I have said in my comment, you should really change your development process so that there is no need for merging/rebasing on
git pull. Don't work on shared branches, but instead always create your own feature branches for your work, and explicitly merge when needed.You can then explicitly configure individual shared branches in your repository for rebasing, e.g.
As for the hook, there is no specific hook for
git pull. However, there is no harm in updating the tags file on other changes to the tree as well, so you may just thepost-rewrite(forgit rebase) andpost-merge(forgit merge) hooks.See Tim Pope's post Effortless Ctags with Git for details on such a setup.