Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
airs
devtools
Repository navigation
Code
Issues
Pull requests
3
(3)
Actions
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
devtools
/
.env.template
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 1.4 KB
main
Breadcrumbs
devtools
/
.env.template
Copy path
Top
File metadata and controls
Code
Blame
21 lines (17 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
env-init が現在の git worktree 用に .env を生成するためのテンプレート(書式の参照例)。
#
このファイルは bash として 1 回だけ source される。書式の要点:
#
- env-init が worktree 番号 N を export 済み(primary=0 / 派生 worktree=1..99)。
#
- 代入行 NAME=... のみが「評価後の値」で .env に出力される。
#
- コメント行・空行はそのまま素通し。代入以外のロジック行は .env に出力されない。
#
- 先に宣言した変数は後続行から ${NAME} で展開できる(bash 評価のため)。
#
これは書式の参照例。利用側 repo は自分のポート・secret に合わせて独自の .env.template を用意する
#
(.env.sample を一次ソースにして .env.template を作る運用も good practice。プロジェクト次第)。
#
文字列リテラル
APP_NAME
=
"
devtools
"
#
N を使った算術。worktree ごとにポートをずらす(例: primary=3000, N=1 の worktree=3001)。
PORT_APP
=
$(
(3000 + N
)
)
#
先に宣言した変数の展開。APP_NAME と PORT_APP を参照して URL / DB 名を組み立てる。
APP_URL
=
"
http://localhost:
${
PORT_APP
}
"
DATABASE_URL
=
"
postgres://localhost:
$(
(5432 + N
)
)/
${
APP_NAME
}
"
#
コマンド置換による乱数 secret 生成。openssl は利用側 repo の環境(devbox 等)が供給する。
SESSION_SECRET
=
$(
openssl rand -base64 32
)
You can’t perform that action at this time.