At present the for loop included in "run_autogit()" results in "cd()" loose the ability to detect if its in a git repo. Once I changed back to your old logic it worked again; so changed back to: 