https://github.com/yasshi2525/export-gitproject
copy and replace current git project with custom rules for exporting another git project.
https://github.com/yasshi2525/export-gitproject
git
Last synced: 2 months ago
JSON representation
copy and replace current git project with custom rules for exporting another git project.
- Host: GitHub
- URL: https://github.com/yasshi2525/export-gitproject
- Owner: yasshi2525
- License: mit
- Created: 2025-06-07T15:27:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-07T16:02:52.000Z (about 1 year ago)
- Last Synced: 2025-06-08T21:36:56.137Z (about 1 year ago)
- Topics: git
- Language: TypeScript
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# export-gitproject
既存の Git プロジェクトを別のプロジェクトとしてエクスポートします。
ファイルを別のファイルで置き換えたり、一部のファイルを除外してエクスポートできます。
## 使い方
```bash
export-gitproject [--config=] [--cwd=]
```
| オプション名 | 必須か | 値の例 | 省略時のデフォルト値 | 説明 |
| --------------- | ------ | -------------------- | ------------------------ | --------------------------------------------- |
| `--config`,`-c` | No | `custom.config.json` | `export-gitproject.json` | 設定ファイルのパスを指定します |
| `--cwd`,`-d` | No | `other_project` | `.` | 出力対象の Git プロジェクトディレクトリのパス |
### 設定ファイル
本コマンドの実行には設定ファイル `./export-gitproject.json` が必要です。
設定ファイルのパスはコマンドオプション `--config`,`-c` で変更できます。
`./export-gitproject.json` の例
```json
{
"copy": {
"exclude": ["replace"]
},
"replace": [
{
"from": "replace/overwritten_by",
"to": "replace/original"
}
]
}
```
| パラメタ | 必須か | 値の例 | 省略時のデフォルト値 | 説明 |
| -------------------------- | ------ | ---------------- | -------------------- | ---------------------------------------------------------------------- |
| `out` | No | `"dest"` | `"out"` | エクスポート先のパス |
| `copy.exclude` | No | `["lib"]` | `[]` | エクスポートしないパターン |
| `replace` | No | | `[]` | ファイルを置き換えるルール |
| `replace[].from` | Yes | `"dummy-images"` | - | `to`ディレクトリはこのディレクトリに置き換えられます |
| `replace[].to` | Yes | `"images"` | - | このディレクトリは`from`ディレクトリに置き換えられます |
| `replace[].errorOnUnmatch` | No | `true` | `false` | `from`と`to`ディレクトリのファイル構成に差があった場合にエラーとするか |
`copy.exclude` は `.gitignore` で指定可能なパターンを指定できます。
なお、設定によらず `.git`, `.gitignore` にマッチするファイル, 設定ファイル はエクスポートされません。
なお、設定ファイルの JSON スキーマは[こちら](https://raw.githubusercontent.com/yasshi2525/export-gitproject/main/config.schema.json)で公開しています。
# License
MIT License
# Author
yasshi2525 [X](https://x.com/yasshi2525)