Clean up the direction change logic
move the .gitignore up to the repository level