Add .gitignore and fix a bug in publish version