Mac终端下进入project的根目录,输入以下命令(使用默认的编辑器打开),打开.gitignore文件
open -t .gitignore
输入以下内容,保存一下
# OSX
*.DS_Store
# Gradle files
build/
.gradle/
*/build/
# IDEA
*.iml
.idea/.name
.idea/encodings.xml
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/workspace.xml
.idea/libraries
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
antLauncher/bin
antLauncher/gen
# Local configuration file (sdk path, etc)
local.properties
# Log Files
*.log
相关命令:
ls -af : 查看隐藏文件