cd before and after git init as well as mkdir before

Signed-off-by: Mattias Andrée <maandree@operamail.com>