热门角色不仅是灵感来源,更是你的效率助手。通过精挑细选的角色提示词,你可以快速生成高质量内容、提升创作灵感,并找到最契合你需求的解决方案。让创作更轻松,让价值更直接!
我们根据不同用户需求,持续更新角色库,让你总能找到合适的灵感入口。
本提示词专为软件版本控制场景设计,提供专业且结构化的仓库创建指导。通过明确角色定位与系统化工作流程,能够根据具体项目需求生成包含环境准备、仓库初始化、分支策略配置等完整步骤的实施方案。特别注重技术文档的准确性与可操作性,避免主观评价,确保输出内容符合行业最佳实践,适用于各类软件开发团队的版本控制体系建设。
Objective: Establish a standardized, secure, and collaborative Git repository for the “LegacyERP Core System,” supporting both new project initialization and migration of an existing codebase, with branch strategy, access control, and end-to-end verification.
Ensure the following tools and access are ready:
Verify Git and set global configuration:
git --version
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
# Line endings (choose one)
# Windows:
git config --global core.autocrlf true
# macOS/Linux:
git config --global core.autocrlf input
Generate and add an SSH key (recommended for authentication):
# Create an Ed25519 key
ssh-keygen -t ed25519 -C "your.email@example.com"
# Start agent and add key (Git Bash/macOS/Linux)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Copy public key to clipboard, then add it in the platform’s SSH keys settings
# macOS:
pbcopy < ~/.ssh/id_ed25519.pub
# Linux:
xclip -sel clip < ~/.ssh/id_ed25519.pub # or cat ~/.ssh/id_ed25519.pub
# Windows (PowerShell):
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
Test SSH connectivity (run the one matching your platform):
ssh -T git@github.com
ssh -T git@gitlab.com
ssh -T git@bitbucket.org
Optional credential helpers (HTTPS use only):
# Windows:
git config --global credential.helper manager-core
# macOS:
git config --global credential.helper osxkeychain
# Linux (if libsecret installed):
git config --global credential.helper libsecret
Choose one of the following initialization paths.
A. New repository (no existing Git history):
mkdir legacyerp-core && cd legacyerp-core
git init -b main
printf "# LegacyERP Core System\n\nRepository for the core system codebase.\n" > README.md
# Minimal, language-agnostic .gitignore
cat > .gitignore << 'EOF'
# OS
.DS_Store
Thumbs.db
# Editors/IDE
.vscode/
.idea/
*.swp
# Build/Artifacts
build/
dist/
target/
bin/
obj/
*.log
# Dependency caches (common)
.node_modules/
.venv/
vendor/
packages/
EOF
git add .
git commit -m "Initialize LegacyERP Core System repository"
B. Migration from an existing Git codebase (preserve history):
# In existing project working directory
# Ensure the default branch is 'main'
git branch -m master main 2>/dev/null || true
git branch -m MAIN main 2>/dev/null || true
# Clean up any stale references
git remote remove origin 2>/dev/null || true
# Add minimal .gitignore if not present
[ -f .gitignore ] || cat > .gitignore << 'EOF'
.DS_Store
Thumbs.db
.vscode/
.idea/
*.swp
build/
dist/
target/
bin/
obj/
*.log
EOF
git add .gitignore
git commit -m "Add baseline .gitignore" || true
Optional: Configure Git LFS for large binary assets (before adding large files):
# Install Git LFS (follow your OS instructions), then:
git lfs install
# Example patterns; customize as needed for binaries >10MB
git lfs track "*.psd" "*.zip" "*.bin" "*.iso"
git add .gitattributes
git commit -m "Configure Git LFS for large binaries" || true
Create an empty repository named “LegacyERP-Core-System” on your chosen platform.
gh repo create ORG/LegacyERP-Core-System --private --description "LegacyERP Core System"
glab repo create ORG/LegacyERP-Core-System --private --name "LegacyERP Core System"
Associate the local repository with the remote and push:
# Replace placeholders accordingly:
# GitHub:
git remote add origin git@github.com:ORG/LegacyERP-Core-System.git
# GitLab:
# git remote add origin git@gitlab.com:GROUP/LegacyERP-Core-System.git
# Bitbucket:
# git remote add origin git@bitbucket.org:WORKSPACE/LegacyERP-Core-System.git
git push -u origin main
Create and push the develop branch:
git checkout -b develop
git push -u origin develop
git checkout main
Adopt the following branch model:
Create initial branch patterns (locally, as needed):
# Example feature branch template usage:
git checkout -b feature/initial-setup develop
# After work, push:
git push -u origin feature/initial-setup
Configure branch protection in the platform:
GitHub:
GitLab:
Bitbucket:
Optional policies:
Assign repository permissions:
GitHub:
mkdir -p .github
cat > .github/CODEOWNERS << 'EOF'
# Example: require review from core maintainers for critical paths
/ @org/legacyerp-core
EOF
git add .github/CODEOWNERS
git commit -m "Add CODEOWNERS"
git push
GitLab:
Bitbucket:
Recommended defaults:
Perform the following to validate the workflow:
cd /tmp
git clone git@github.com:ORG/LegacyERP-Core-System.git
cd LegacyERP-Core-System
git fetch --all --prune
git branch -r
git checkout -b dryrun-main-edit main
printf "\nValidation: %s\n" "$(date -u +%FT%TZ)" >> README.md
git add README.md
git commit -m "Validation: attempt direct commit to main"
git push origin HEAD:main
# Expected: push rejected due to branch protection
git checkout develop
git pull
git checkout -b feature/validation
printf "\nFeature validation note\n" >> README.md
git add README.md
git commit -m "Add feature validation note"
git push -u origin feature/validation
git checkout develop
git pull
git checkout main
git pull
git tag -a v0.1.0 -m "Initial baseline for LegacyERP Core System"
git push origin v0.1.0
git checkout -b hotfix/0.1.1 v0.1.0
# Apply fix
git commit -am "Fix: critical issue in 0.1.0"
git push -u origin hotfix/0.1.1
# Open PR/MR into main; after merge, back-merge or cherry-pick into develop
mkdir -p .github
cat > .github/pull_request_template.md << 'EOF'
Summary:
Changes:
Testing:
Checklist:
- [ ] Code builds
- [ ] Tests pass
- [ ] No secrets added
EOF
git add .github/pull_request_template.md
git commit -m "Add PR template"
git push
SSH “Permission denied (publickey)”:
Remote already exists or incorrect:
git remote -v
git remote set-url origin git@<host>:<OWNER>/<REPO>.git
Line-ending issues across OS:
Large files and LFS:
Accidental secret commit:
Merge conflicts:
git fetch --all
git checkout feature/branch
git merge origin/develop # or rebase if policy allows
# Resolve conflicts in files
git add <resolved files>
git commit
git push
# Local rename (if needed)
git branch -m master main
# Push and set upstream
git push -u origin main
# Update default branch in platform settings to 'main'
This guide provides a complete, actionable setup for the LegacyERP Core System repository, from environment preparation to protected-branch collaboration and validation.
IoT 平台 Monorepo の新規 Git リポジトリを作成し、チームで安全かつ効率的に開発できるよう、環境準備から初期化・リモート接続・ブランチ戦略・権限設定・検証までの全手順を定義する。対象は GitHub または GitLab を用いた一般的なチーム開発環境。モノレポ構成に対応し、main(安定版)、develop(統合)、feature/release/hotfix(作業系)の複数ブランチ管理と保護を設定する。
確認コマンド例:
git --version
ssh -V
1-1. Git の初期設定
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
git config --global init.defaultBranch main
1-2. SSH キー作成と登録(SSH 接続を使用する場合)
ssh-keygen -t ed25519 -C "your-email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
GitHub に公開鍵登録: Settings -> SSH and GPG keys -> New SSH key
GitLab に公開鍵登録: Preferences -> SSH Keys -> Add SSH Key
接続確認:
ssh -T git@github.com
ssh -T git@gitlab.com
1-3.(任意)Git LFS の導入(大容量ファイルを扱う場合)
git lfs install
1-4.(任意)CLI の導入
2-1. ディレクトリ作成と初期化
mkdir iot-platform-monorepo
cd iot-platform-monorepo
git init --initial-branch=main
2-2. モノレポ標準構成の作成
mkdir -p services/service-a
mkdir -p services/service-b
mkdir -p libs/common
mkdir -p infra
mkdir -p docs
mkdir -p scripts
mkdir -p tools
2-3. 必須ファイルを作成 README.md:
# IoT 平台 Monorepo
本リポジトリは IoT プラットフォームのモノレポ構成を管理します。
.gitattributes(改行コードの統一・マージ挙動の既定化):
* text=auto eol=lf
*.sh text eol=lf
*.bat text eol=crlf
*.png binary
*.jpg binary
.gitignore(一般的な除外例):
# OS / Editor
.DS_Store
Thumbs.db
*.swp
.vscode/
.idea/
# Dependencies / Builds
node_modules/
dist/
build/
target/
venv/
__pycache__/
*.log
CODEOWNERS(例: ディレクトリ別のレビュー必須設定)
# CODEOWNERS は .github/ または .gitlab/ 配下でも可
/services/ @team-services
/libs/ @team-libs
/infra/ @team-infra
GitHub Actions(任意・簡易 CI サンプル: .github/workflows/ci.yml)
name: CI
on:
pull_request:
push:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "CI ok"
GitLab CI(任意・簡易 CI サンプル: .gitlab-ci.yml)
stages: [test]
echo:
stage: test
script:
- echo "CI ok"
2-4. 初回コミット
git add .
git commit -m "chore: initial repository structure for IoT Platform Monorepo"
方式A: GitHub(Web UI)
方式B: GitLab(Web UI)
方式C: CLI(任意・環境が整っている場合)
gh repo create ORG/iot-platform-monorepo --private --source=. --remote=origin --push
glab repo create ORG/iot-platform-monorepo --private --init=false
git remote add origin git@gitlab.com:ORG/iot-platform-monorepo.git
git push -u origin main
手動で関連付け・初回プッシュ(Web UI で作成した場合):
git remote add origin git@github.com:ORG/iot-platform-monorepo.git
git push -u origin main
4-1. ブランチ方針
4-2. 初期ブランチ作成・プッシュ
git branch develop
git push -u origin develop
4-3. ブランチ保護ルール
GitHub:
CODEOWNERS を有効にするには
GitLab:
GitHub:
GitLab:
リポジトリ直下に CODEOWNERS を配置し、ディレクトリ単位のレビュー必須を適用する。
6-1. クローン検証
cd ..
git clone git@github.com:ORG/iot-platform-monorepo.git
cd iot-platform-monorepo
git remote -v
6-2. feature ブランチの作成・プッシュ
git checkout -b feature/device-registry
echo "Device registry draft" >> docs/device-registry.md
git add docs/device-registry.md
git commit -m "feat(docs): add device registry draft"
git push -u origin feature/device-registry
6-3. PR/MR の作成
6-4. main へのリリースフロー
git checkout develop
git checkout -b release/0.1.0
git push -u origin release/0.1.0
6-5. タグ付与と配布
git checkout main
git pull
git tag -a v0.1.0 -m "Release 0.1.0"
git push origin v0.1.0
6-6. hotfix フロー
git checkout main
git checkout -b hotfix/critical-fix
# 変更作業
git commit -m "fix: critical issue"
git push -u origin hotfix/critical-fix
6-7. 保護ルールの動作確認(拒否を期待)
git checkout main
git commit --allow-empty -m "test: direct push to main should be blocked"
git push origin main
一般的な問題と対処:
git lfs install
git lfs track "*.bin"
git add .gitattributes
運用上の留意点:
以上により、IoT 平台 Monorepo の初期セットアップから協調開発・保護・検証までの一連の手順が完成する。
用一条可复用的高效提示词,快速搭建“规范、可执行、可复用”的版本控制仓库指南,覆盖新建、迁移、多人协作与分支管理等主流场景。它将最佳实践沉淀为清晰的操作SOP:从环境检查、仓库初始化、远程关联,到分支保护、成员权限、全流程验收与排错,一步到位。核心价值:
快速建立团队统一的仓库模板与分支策略,十分钟产出可评审的实施方案,减少返工与协作摩擦。
一键生成新仓库的保护规则与权限清单,规范合并流程与回滚预案,降低误操作与线上风险。
按图完成本地环境自检、首次提交与推送,快速融入团队工作流,减少求助与等待时间。
将模板生成的提示词复制粘贴到您常用的 Chat 应用(如 ChatGPT、Claude 等),即可直接对话使用,无需额外开发。适合个人快速体验和轻量使用场景。
把提示词模板转化为 API,您的程序可任意修改模板参数,通过接口直接调用,轻松实现自动化与批量处理。适合开发者集成与业务系统嵌入。
在 MCP client 中配置对应的 server 地址,让您的 AI 应用自动调用提示词模板。适合高级用户和团队协作,让提示词在不同 AI 工具间无缝衔接。
半价获取高级提示词-优惠即将到期