What exactly is wrong with
cd? If you want to stay in the current directory then do everything in a subshell: (cd …&& qmake && make). Or do you want to build in the current directory because you cannot write inside /usr/local/src/mygitproject? What is wrong with copying mygitproject to ~/mygitproject and working from there? Please make sure there is no XY problem here. [Edit] the question and clarify.