The common practice is to not store the entire history of the subproject in your main repository, but If you want to preserve it just omit the –squash flag
git subtree add --prefix .emacs.d/rtags https://github.com/abelardojarab/rtags master --squash
git subtree pull --prefix=.emacs.d/rtags --squash https://github.com/abelardojarab/rtags.git master