Skip to content

fix: stop tracking .env and ship .env.example instead - #539

Open
softwarebyze wants to merge 1 commit into
obytes:masterfrom
softwarebyze:fix/gitignore-env
Open

fix: stop tracking .env and ship .env.example instead#539
softwarebyze wants to merge 1 commit into
obytes:masterfrom
softwarebyze:fix/gitignore-env

Conversation

@softwarebyze

Copy link
Copy Markdown

Problem

The template tracks .env on master:

https://github.com/obytes/react-native-template-obytes/blob/master/.env

SECRET_KEY=my-secret-key
APP_BUILD_ONLY_VAR=build-only-value

create-obytes-app clones this repo, so every new app starts with a committed .env. The docs already tell people to put build-time secrets in .env without EXPO_PUBLIC_ — which is correct for Metro, but dangerous while .env is tracked. A real token is one git add . away from GitHub.

.p8 / .key / .p12 are already gitignored. .env is not.

Fix

  • Rename tracked .env.env.example (same keys, dummy values)
  • Gitignore .env and .env*.local
  • Docs: copy .env.example.env locally; do not commit .env

Evidence

$ git ls-files .env
.env
$ git show master:.env | grep SECRET
SECRET_KEY=my-secret-key

On master today, that file is part of the tree. After this PR, git ls-files .env is empty and new clones only get .env.example.

The template currently commits .env (including SECRET_KEY=my-secret-key).
create-obytes-app copies that into every new app, so a real token typed
into .env is one git add away from being pushed.

Keep the same keys in .env.example, gitignore .env / .env*.local, and
document the copy step.
@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for obytes-starter ready!

Name Link
🔨 Latest commit 68f891b
🔍 Latest deploy log https://app.netlify.com/projects/obytes-starter/deploys/6a911b11ffa49d0008028ec6
😎 Deploy Preview https://deploy-preview-539--obytes-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant