---
title: 创建 Git 仓库
---

经过以上操作，现在项目的目录结构变成了这样：

```md
.
├── node_modules/
├── dist/
├── src/
│   └── App.jsx
├── package.json
└── pnpm-lock.yaml
```

`dist` 和 `log` 都是框架生成的构建产物和运行产物，不应该进入仓库索引，需要在项目根目录下添加一个 `.gitignore`，内容：

```txt
node_modules/
dist/
*.log*
```

然后可以执行 `git init` 等命令创建仓库。

虽然手动创建一个 Modern.js 项目也很简单，但如果用 Modern.js 开发套件提供的工具，自动创建项目还可以更方便，并且获得更多开箱即用的最佳实践（比如上面的 .gitignore 等等）。

---

> 本章节的代码可以在[这里查看](https://github.com/modern-js-dev/modern-js-examples/tree/main/tutorials/c01/hello-modern)。
