- Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Description
Terraform Version
Terraform v0.11.10 Also note that this is Windows 10, with git version 2.19.1.windows.1
Expected Behavior
I have authored some modules in a local git repo. Modules are in one path, and terraform files in another path. When I git clean the repo, I expect only .terraform folder to be removed
Actual Behavior
Module files are deleted from the filesystem when the .terraform dir is removed
Steps to Reproduce
From a clean git repo containing terraform modules in one path, and terraform files in another such as:
├───Environment │ └───DingDev │ ├───Core │ ├───Dev │ └───Networks └───Modules ├───Stripe ├───Vpc └───Vpn 1 terraform init in (say) the Dev folder which contains .tf files importing modules from the Modules folder
[master ≡]> terraform init Initializing modules... - module.pink Getting source "../../../Modules/Stripe" 2 git clean -fxd to remove the .terraform directory:
[master ≡]> git clean -fxd Removing .terraform/ - Discover that all the files in
../../../Modules/Stripehave been removed:
[master ≡ +0 ~0 -2 !]> git status On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) deleted: ../../../Modules/Stripe/inputs.tf deleted: ../../../Modules/Stripe/main.tf no changes added to commit (use "git add" and/or "git commit -a") Additional Context
This is my .gitignore:
terraform.tfvars terraform.tfstate *.backup .terraform *.swp Metadata
Metadata
Assignees
Labels
No labels