回答
你想排除版本控制的唯一目錄是.meteor/local
。
流星會自動創建正確的.meteor
和.meteor/.gitignore
,但是 - 您不需要執行任何操作。
這仍然是這種情況嗎?因爲這個我今天下午開始了一個項目,沒有找到.gitignore。 – akst
heh。現在我懂了。它不在項目根目錄內,而是在.meteor文件夾內。 – Nek
我忽略了整個.meteor目錄沒有'包'文件,我現在沒有任何問題在不同的環境中移動項目。 – thinklinux
你可能想要把所有的配置設置文件在那裏,如果你正在推動公共回購。
我存儲的任何安全敏感數據的配置設置,如加密密鑰和用於SMTP一樣,Twitter,Facebook和其他服務在config.js各種密碼,然後把在的.gitignore或在信息/排除文件。東西我不想在公共回購。
只是一個額外的建議,考慮爲您的.gitignore
你不應該忽略這個答案,因爲接受的答案不會阻止你在'settings.json'中發佈你的社交媒體和AWS標記。 – Jesse
據this article,你應該忽略你的settings.json
,特別是如果你有環境的具體信息,包括API密鑰。
流星會在.meteor
目錄默認情況下.gitignore
。
但是,您的項目的.gitignore
應該排除任何敏感數據配置文件和node_modules
。
如果排除node_modules,則必須在package.json「dependencies」部分中包含任何子目錄。否則,它可能會導致你的部署。 – Deborah
如果使用
- Intellij IDE忽略
.idea
文件夾 - Sublime Text忽略
sublime-project
sublime-workspace
如果你是Mac用戶,你可以忽略DS_Store
,如果您使用NPM忽略npm
如果博th windows和mac用戶在同一個項目上工作,因爲相同的npm版本對於mac和windows是不同的,所以它顯示錯誤。
intellij的問題是您將失去ECMAScript級別。 –
一起來看流星1.3你也想忽略node_modules
。沒有理由將所有庫添加到git中,因爲您可以通過npm安裝它們。該node_modules
文件夾最有可能比你的應用程序(不包括.meteor/local
文件夾)
- gitignore用於忽略了git的服務器和讀取所有的時間所有的不必要的負擔更大。
- 所以把最好的東西放在gitignore裏面是可打包的實體。現在,這包括流星可下載的軟件包,因此,您應該在gitignore中添加「.meteor/local」。
- 當您將它添加到gitignore配置中時,它將項目的大小減小到與包一樣小n倍。
- 如果您現在將整個項目剪切粘貼到不同位置,或者在沒有.meteor/local文件夾的情況下獲取存儲庫並使用meteor命令啓動該項目,則流星會首先下載所需的軟件包,然後啓動服務器。
下面是我使用Webstorm和流星1.4與Mupx部署。
# Meteor files to ignore now handled by .ignore file within .Meteor folder automatically
# settings file to ignore to protect API keys
settings.json
# MUP/MUPX file to ignore to protect server passwords and sensitive info.
mup.json
# npm package files to ignore
node?modules/
npm-debug.log
# Webstorm IDE files to ignore
.idea/*
# Typing type definition files to ignore. Webstorm uses type definitions for autocomplete even without typescript
typings/*
這是.gitignore文件以我的IntelliJ使用:
node_modules/
.meteor/local/*
.idea/
npm-debug.log
packages/*/.npm/
我們用這個gitignore,這englobes許多IDE和流星,以及系統文件等。
### WebStorm ###
.idea/
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows shortcuts
*.lnk
### Linux ###
*~
# KDE directory preferences
.directory
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### Node/NPM ###
node_modules
npm-debug.log
### Development ###
dump
mochawesome-reports
ngrok
您需要將安裝的軟件包目錄名爲node_modules,它位於根目錄中。當你提交項目時,它將被忽略。產品經理也可以使用package.json輕鬆地在他們的服務器上安裝軟件包。
### MeteorJS ###
# default meteor build and local packages
.meteor/local
# meteor settings file
settings.json
# meteor build output files
*.tar.gz
# general swp files from vim
*.swp
# End of https://www.gitignore.io/api/meteorjs
- 1. Gitignore文件流星
- 2. 哪兒我應該把.gitignore文件以Android Studio中項目
- 3. PDO我應該怎麼把文件
- 4. 我應該提交.gitignore文件嗎?
- 5. 在我gitignore文件的gitignore
- 6. 我應該.gitignore我的gradlew?
- 7. 我應該什麼時候訂閱流星收藏?
- 8. 我應該把什麼,以imeActionId?
- 9. 我應該把什麼東西放進課堂,我不應該做什麼?
- 10. 我在流星的package.json文件中需要什麼?
- 11. 在什麼「事件」我應該把-account-ID會話代碼?
- 12. 我的gitignore與Microsoft Fakes應該是什麼?
- 13. 我應該把什麼尺寸的圖像放在drawable-mdpi文件夾中
- 14. 我應該把我的製作網站放入什麼文件夾?
- 15. 我應該使用流星包還是複製js文件?
- 16. 我應該將yarn-error.log添加到我的.gitignore文件中嗎?
- 17. dbnavigator.xml應該在gitignore
- 18. 爲什麼流星把所有的js都放在開頭?
- 19. 什麼是「!」在gitignore文件中做?
- 20. 添加文件時,爲什麼我的.gitignore文件不工作?
- 21. 我應該把索引放在什麼上的MySql?
- 22. 我應該把什麼分數放在elasticsearch的增強字段
- 23. Django的我應該在哪裏把我的CSS文件
- 24. 什麼是Meteor.autorun在流星?
- 25. 爲什麼我的流星方法404
- 26. 我應該把使用版本放在我的文件頂部
- 27. 什麼是流星
- 28. 在'.gitignore'文件中應該忽略哪些項目文件?
- 29. 多卡支付 - 我應該把什麼放在收信人上?
- 30. 爲什麼我應該把外部資源放在html頭部?
'settings.json'特別是如果你有API令牌在那裏。 – Jesse
我使用webstorm,我的.gitignore中唯一的一行是 '''.idea /''' – Dude