Remove the common path prefix for \g