How to replace a "package" for its "package"-git version gently?

First build the package then install it

Some pkgbuilds require could more effort: How to install mesa-git? - #6 by Lolix