Initial commit
This commit is contained in:
18
commands/create_worktree.md
Normal file
18
commands/create_worktree.md
Normal file
@@ -0,0 +1,18 @@
|
||||
Create a new Git worktree with branch name and optional path: $ARGUMENTS
|
||||
|
||||
First, parse the arguments to extract:
|
||||
- Branch name (required, first argument)
|
||||
- Worktree path (optional, second argument - if not provided, use ../project-{branch-name})
|
||||
|
||||
Then execute these steps:
|
||||
1. Verify we're in a Git repository
|
||||
2. Show current worktrees with `git worktree list`
|
||||
3. Create the worktree using `git worktree add <path> -b <branch-name>`
|
||||
4. Navigate to the new worktree directory
|
||||
5. List directory contents and check for dependency files (package.json, requirements.txt, etc.)
|
||||
6. Install dependencies for each service:
|
||||
- Run `npm ci` in astro/ directory (frontend dependencies)
|
||||
- Run `npm ci` in strapi/ directory (CMS dependencies)
|
||||
- Run `npm ci` in tests/ directory (test dependencies)
|
||||
7. Provide instructions on how to start working in the new worktree
|
||||
If any errors occur, explain them and suggest solutions.
|
||||
18
commands/merge_worktree.md
Normal file
18
commands/merge_worktree.md
Normal file
@@ -0,0 +1,18 @@
|
||||
Merge the current worktree back to the target branch and clean up: $ARGUMENTS
|
||||
|
||||
Parse arguments to extract:
|
||||
- Target branch (required, first argument like 'master' or 'develop')
|
||||
|
||||
Execute these steps:
|
||||
1. Check if we're currently in a worktree (not the main repo)
|
||||
2. Get current branch name with `git branch --show-current`
|
||||
3. Check for uncommitted changes with `git status`
|
||||
4. If there are uncommitted changes stop process and ask user to commit changes.
|
||||
5. Push the current branch to origin
|
||||
6. Navigate back to the main repository directory
|
||||
7. Switch to the target branch and pull latest changes
|
||||
8. Merge the current branch into the target branch
|
||||
9. Remove the worktree with `git worktree remove <worktree-path>`
|
||||
10. Ask if I should delete the feature branch locally
|
||||
|
||||
Handle any merge conflicts by explaining the resolution process.
|
||||
Reference in New Issue
Block a user