首页 > 解决方案 > 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

有人可以给我建议吗

  1. .aws-sam每个 Lambda 函数内部都有一个文件夹并且每个文件夹中都有完整的代码集是否正常?
  2. 在 git 中,我该如何解决这个问题?

标签: node.jsgitamazon-web-servicesaws-lambdaaws-api-gateway

解决方案


推荐阅读