[git] Add a global .gitignore file
[prepare_system.sh] Fix some bugs with command ordering