Set up jj repositories including colocation decisions, integrate with development tools like Vite/Vitest, and choose between jj library and CLI for tooling. Use when setting up new repositories, experiencing tool integration issues, or building jj integrations.
This skill has safety concerns that you should review before use. Some patterns were detected that may pose a risk.Safety score: 75/100.
KillerSkills scans all public content for safety. Use caution before installing or executing flagged content.
**Key decisions:**
Understanding these choices helps you set up repositories correctly and avoid common integration issues.
**What is colocation?**
Using jj and git in the same working directory:
```
my-repo/
├── .git/ # Git repository
├── .jj/ # Jujutsu repository
└── src/ # Shared working directory
```
**Creating colocated repository:**
```bash
cd my-git-repo
jj git init --colocate
jj git init --colocate my-repo
cd my-repo
```
**Creating jj-only repository:**
```bash
jj git init my-repo
cd my-repo
```
**Advantages:**
**Drawbacks:**
**Recommendation:**
| Scenario | Recommendation |
|----------|----------------|
| Learning jj | Colocate (easier transition) |
| Team migration | Colocate (gradual adoption) |
| New personal project | jj-only (cleaner) |
| Legacy git project | Colocate (tool compatibility) |
| CI/CD requirements | Colocate (git tooling) |
**Problem:** `jj` commands slow or hang in Vite/Vitest projects.
**Cause:** Vite's file watcher monitors `.jj` directory, causing conflicts and slowdowns.
**Solution:** Configure Vite to ignore `.jj`:
```javascript
// vite.config.js or vite.config.ts
export default {
server: {
watch: {
ignored: ['**/.jj/**']
}
}
}
```
**For Vitest:**
```javascript
// vitest.config.js or vitest.config.ts
export default {
test: {
// ... other config
watch: {
ignored: ['**/.jj/**']
}
}
}
```
**Complete example:**
```javascript
import { defineConfig } from 'vite'
export default defineConfig({
server: {
watch: {
ignored: [
'**/.jj/**', // Ignore jj directory
'**/.git/**', // Good practice to ignore git too
'**/node_modules/**'
]
}
}
})
```
**Common issues and fixes:**
**File watchers:**
**IDEs (VS Code, IntelliJ, etc.):**
```json
// .vscode/settings.json
{
"files.watcherExclude": {
"**/.jj/**": true
},
"search.exclude": {
"**/.jj/**": true
}
}
```
**Build tools:**
**Linters/formatters:**
```yaml
.jj/
```
**Question:** Should I use the jj library or parse CLI output?
**Answer:** Both have trade-offs. Library avoids parsing but isn't stable. CLI is also unstable but more flexible.
**Pros:**
**Cons:**
**When to use:**
**Pros:**
**Cons:**
**When to use:**
```bash
jj log --no-pager
jj log --template 'commit_id ++ "\t" ++ description.first_line() ++ "\n"'
jj log -r 'mine() & after("1 week ago")'
if jj status &>/dev/null; then
echo "In jj repository"
fi
```
**Example Python integration:**
```python
import subprocess
import json
def jj_log(revset="@"):
result = subprocess.run(
["jj", "log", "-r", revset, "--no-pager",
"--template", "json"],
capture_output=True,
text=True
)
return json.loads(result.stdout)
```
Use this skill when:
Don't use this skill for:
For detailed setup guides, configuration examples, and integration patterns:
📚 **See detailed docs:** `faq-reference.md`
This includes:
```bash
jj git init --colocate # Colocated repo (jj + git)
jj git init # jj-only repo
jj git init --colocate existing-git-repo # Add jj to git repo
~/.jjconfig.toml # Global config
.jj/repo/config.toml # Repository config
server.watch.ignored = ['**/.jj/**']
"files.watcherExclude": {"**/.jj/**": true}
```
**Colocation is a choice, not a requirement.** Use it when you need git compatibility, prefer pure jj otherwise. Always configure development tools to ignore `.jj/` directory to avoid conflicts and performance issues.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/setting-up-jujutsu-repositories-and-tool-integration/raw