When promoting code on github it is usually a good idea not to promote files like .DS_Store. .classpath etc. To accomplish this you can include a .gitignore file in your first commit. Git uses it to determine which files and directories to ignore, before you make a commit. Here is what my .gitignore looks like:
/.buildpath
/build/
*/archive/
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
.project
.settings
.classpath
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Icon?
Alternatively, you can create a global .gitignore file, which is a list of rules for ignoring files in every Git repositories on your computer. For example, you might create the file at ~/.gitignore_global and add some rules to it. In your terminal run the following command and you should be all set:
git config --global core.excludesfile ~/.gitignore_global
Comments
Post a Comment