Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Could/should azd add a .gitignore to .azure? #2755

Closed
pamelafox opened this issue Sep 18, 2023 · 3 comments · Fixed by #3715
Closed

[Issue] Could/should azd add a .gitignore to .azure? #2755

pamelafox opened this issue Sep 18, 2023 · 3 comments · Fixed by #3715
Assignees
Milestone

Comments

@pamelafox
Copy link
Member

I just learned that subdirectories can have .gitignore's! Apparently lots of tools add .gitignore to their created folders, like venv recently did:
python/cpython#83417

I wonder if it'd make sense for .azure to have a .gitignore? (Instead of adding itself to the repo's .gitignore?)

Just a thought!

@jasontaylordev
Copy link

jasontaylordev commented Oct 10, 2023

I wonder if it'd make sense for .azure to have a .gitignore? (Instead of adding itself to the repo's .gitignore?)

Hey @pamelafox - I wonder what would be the point of that? Specifying .azure in .gitignore at the repo level means that the folder will be ignored by Git.

If you remove .azure from the repo .gitignore, then the folder will be tracked by Git. If you add .gitignore to the .azure folder you could ignore items under that folder. I think this could be useful if you wanted to commit some environments (dev, stg, prd) but exclude others. This would allow you to share specific environments with other members of your team.

We now have support for remote environments, but committing .azure and specific environments would be easy than setting up a storage account.

Thoughts?

@pamelafox
Copy link
Member Author

The benefit of adding a .gitignore with * in .azure is that azd doesn't need to mess with the root .gitignore. It just seems like it might be a bit cleaner, less brittle. I think sometimes I get double .azure's in my .gitignore due to azd logic in how it adds to it.
Functionally, the result would be same as today. It's just a different approach.

@jasontaylordev
Copy link

Thanks, I didn't know that. I did a quick test to confirm behaviour and found:

  1. .gitignore * includes all files and folders contained within .azure
  2. .azure is not committed because it is an empty folder

I like it, nice and simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment