工作流程如下:
- 呼叫Git init程式,建立基本git資料庫
- 產生.gitignore
- 產生.gitattributes
- 把兩個檔案加入git資料庫
- 加上初始註解
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## call git init | |
git init | |
## make .gitignore | |
cat > .gitignore << EOF | |
# Mac OS X Finder and whatnot | |
.DS_Store | |
# no useful files | |
log/*.log | |
tmp/**/* | |
public/cache/**/* | |
doc/api | |
doc/app | |
# xcode noise | |
build/ | |
*.[oa] | |
*.pbxuser | |
*.perspective | |
*.perspectivev3 | |
*.mode1 | |
*.mode1v3 | |
*.mode2v3 | |
# Other source repository archive directories (protects when importing) | |
.hg | |
.svn | |
CVS | |
# automatic backup files | |
*~.nib | |
*.swp | |
*~ | |
*(Autosaved).rtfd/ | |
Backup[ ]of[ ]*.pages/ | |
Backup[ ]of[ ]*.key/ | |
Backup[ ]of[ ]*.numbers/ | |
# Sparkle distribution Private Key (Don't check me in!) | |
dsa_priv.pem | |
EOF | |
## make .gitattributes | |
cat > .gitattributes << EOF | |
*.pbxproj -crlf -diff -merge | |
EOF | |
## add .gitignore and gitattributes to git list | |
git add .gitignore | |
git add .gitattributes | |
## add git commit | |
git commit -m "Git Init for Xcode!" |