node.js - Git:AWS Lambda 项目的活动更改过多问题
问题描述
我正在使用AWS Lambda
和开发一个 REST API Amazon API Gateway
。我正在使用Node.js
这个。也使用sam
工具AWS Cloud Formation
。
我将我的代码发送到 BitBucket,这是我的远程仓库。
但是我可以看到我在本地仓库中遇到了以下问题。
这是因为该.aws-sam
文件夹未提交给 git。
我可以看到我拥有的每个 labda 功能,该.aws-sam
文件夹都创建了一个单独的文件夹。不仅如此,在每个文件夹中,我的整个项目代码都是可用的。因此,我的所有项目文件都在每个文件夹中重复,从而产生超过 5000 个未提交的文件。我有更多的 Lambda 函数要来,所以将来情况会更糟。
这是我的.gitignore
文件
# Created by https://www.gitignore.io/api/osx,node,linux,windows
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
### OSX ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/osx,node,linux,windows
有人可以给我建议吗
.aws-sam
每个 Lambda 函数内部都有一个文件夹并且每个文件夹中都有完整的代码集是否正常?- 在 git 中,我该如何解决这个问题?
解决方案
推荐阅读
- java - 通过 Stream API 迭代和减少 Java 映射的值
- java - Android DatePicker 如何更改样式,不显示数字?
- aws-load-balancer - 是否可以确定哪个 AWS LoadBalancer 是源?
- javascript - FullscreenBookBlock - 在页面上时的活动类
- python - 反复听键盘并根据Bottle中按下的键显示变化
- swift - 如何从 iPhone swift 获取所有文档和笔记?
- php - 在中间剪掉一部分字符串,但保留开始和结束
- python - python3用单个数值打印\
- c++ - 运算符将常量 int 添加到变量
- amazon-web-services - 如何区分s3中的文件夹和前缀