Spaces:
Runtime error
Runtime error
Commit
·
01fa316
1
Parent(s):
faac46c
Delete BRANCHES.md
Browse files- BRANCHES.md +0 -180
BRANCHES.md
DELETED
|
@@ -1,180 +0,0 @@
|
|
| 1 |
-
# Git Branches Guide
|
| 2 |
-
|
| 3 |
-
## Current Branches
|
| 4 |
-
|
| 5 |
-
### `feature/personas` Branch
|
| 6 |
-
**Created:** October 3, 2025
|
| 7 |
-
**Purpose:** Complete persona system implementation replacing the old customPrompts system
|
| 8 |
-
**Status:** Ready for testing and review
|
| 9 |
-
|
| 10 |
-
**What's included (24 commits):**
|
| 11 |
-
- Persona type definition and default personas (healthcare debate perspectives)
|
| 12 |
-
- Database migration to replace customPrompts with personas
|
| 13 |
-
- PersonaSelector component for quick switching
|
| 14 |
-
- Personas gallery page with search, edit, and activation
|
| 15 |
-
- Full CRUD persona editor in settings
|
| 16 |
-
- Tab-based settings navigation (Models, Personas, Settings)
|
| 17 |
-
- Integration with conversation creation and message generation
|
| 18 |
-
- UI redesign for model/persona display in chat window
|
| 19 |
-
|
| 20 |
-
---
|
| 21 |
-
|
| 22 |
-
## How to Push to the Feature Branch
|
| 23 |
-
|
| 24 |
-
From your current state (after rebase), push to the feature branch:
|
| 25 |
-
|
| 26 |
-
```bash
|
| 27 |
-
cd /c/Dev/Plurality/chat
|
| 28 |
-
git push origin main:feature/personas
|
| 29 |
-
```
|
| 30 |
-
|
| 31 |
-
This creates a new branch called `feature/personas` on the remote with all your commits.
|
| 32 |
-
|
| 33 |
-
---
|
| 34 |
-
|
| 35 |
-
## How to Test the Feature Branch
|
| 36 |
-
|
| 37 |
-
**On another machine or after switching:**
|
| 38 |
-
|
| 39 |
-
```bash
|
| 40 |
-
# Switch to the feature branch
|
| 41 |
-
git checkout feature/personas
|
| 42 |
-
|
| 43 |
-
# Pull latest changes
|
| 44 |
-
git pull origin feature/personas
|
| 45 |
-
|
| 46 |
-
# Install dependencies (if needed)
|
| 47 |
-
npm install
|
| 48 |
-
|
| 49 |
-
# Run the application
|
| 50 |
-
npm run dev
|
| 51 |
-
```
|
| 52 |
-
|
| 53 |
-
---
|
| 54 |
-
|
| 55 |
-
## How to Merge Back to Main
|
| 56 |
-
|
| 57 |
-
Once the feature is tested and approved, you have two options:
|
| 58 |
-
|
| 59 |
-
### Option 1: Merge via Pull Request (Recommended)
|
| 60 |
-
1. Create a Pull Request on GitHub/GitLab from `feature/personas` to `main`
|
| 61 |
-
2. Request code review from team members
|
| 62 |
-
3. Once approved, merge using the platform's merge button
|
| 63 |
-
4. Delete the feature branch after merge
|
| 64 |
-
|
| 65 |
-
### Option 2: Manual Merge (Command Line)
|
| 66 |
-
```bash
|
| 67 |
-
# Make sure you're on main and it's up to date
|
| 68 |
-
git checkout main
|
| 69 |
-
git pull origin main
|
| 70 |
-
|
| 71 |
-
# Merge the feature branch
|
| 72 |
-
git merge feature/personas
|
| 73 |
-
|
| 74 |
-
# If there are conflicts, resolve them, then:
|
| 75 |
-
git add .
|
| 76 |
-
git commit -m "Resolve merge conflicts"
|
| 77 |
-
|
| 78 |
-
# Push to main
|
| 79 |
-
git push origin main
|
| 80 |
-
|
| 81 |
-
# Delete the feature branch (optional)
|
| 82 |
-
git branch -d feature/personas
|
| 83 |
-
git push origin --delete feature/personas
|
| 84 |
-
```
|
| 85 |
-
|
| 86 |
-
---
|
| 87 |
-
|
| 88 |
-
## Common Branch Commands
|
| 89 |
-
|
| 90 |
-
### See all branches
|
| 91 |
-
```bash
|
| 92 |
-
git branch -a
|
| 93 |
-
```
|
| 94 |
-
|
| 95 |
-
### Switch branches
|
| 96 |
-
```bash
|
| 97 |
-
git checkout branch-name
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
-
### Create a new branch
|
| 101 |
-
```bash
|
| 102 |
-
git checkout -b new-branch-name
|
| 103 |
-
```
|
| 104 |
-
|
| 105 |
-
### Update your branch with latest main
|
| 106 |
-
```bash
|
| 107 |
-
# While on your feature branch
|
| 108 |
-
git fetch origin
|
| 109 |
-
git rebase origin/main
|
| 110 |
-
```
|
| 111 |
-
|
| 112 |
-
### See what's different between branches
|
| 113 |
-
```bash
|
| 114 |
-
git diff main..feature/personas
|
| 115 |
-
```
|
| 116 |
-
|
| 117 |
-
### Undo/Reset (if needed)
|
| 118 |
-
```bash
|
| 119 |
-
# Undo local changes
|
| 120 |
-
git reset --hard origin/feature/personas
|
| 121 |
-
|
| 122 |
-
# Go back to a specific commit
|
| 123 |
-
git reset --hard COMMIT_HASH
|
| 124 |
-
```
|
| 125 |
-
|
| 126 |
-
---
|
| 127 |
-
|
| 128 |
-
## Branching Best Practices
|
| 129 |
-
|
| 130 |
-
1. **One feature per branch** - Keep branches focused on a single feature or fix
|
| 131 |
-
2. **Descriptive names** - Use names like `feature/personas`, `fix/login-bug`, `refactor/api-cleanup`
|
| 132 |
-
3. **Regular updates** - Rebase with main regularly to avoid large conflicts later
|
| 133 |
-
4. **Small commits** - Make frequent, logical commits with clear messages
|
| 134 |
-
5. **Clean up** - Delete merged branches to keep the repository tidy
|
| 135 |
-
6. **Never force push to main** - Use `--force` only on feature branches and only when necessary
|
| 136 |
-
|
| 137 |
-
---
|
| 138 |
-
|
| 139 |
-
## Troubleshooting
|
| 140 |
-
|
| 141 |
-
### "Your branch has diverged"
|
| 142 |
-
This happens when remote and local have different commits. Solutions:
|
| 143 |
-
```bash
|
| 144 |
-
# If you want to keep your local changes
|
| 145 |
-
git rebase origin/branch-name
|
| 146 |
-
|
| 147 |
-
# If you want to match remote exactly
|
| 148 |
-
git reset --hard origin/branch-name
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
### Merge Conflicts
|
| 152 |
-
When Git can't automatically merge:
|
| 153 |
-
1. Open conflicted files (marked with `<<<<<<<`, `=======`, `>>>>>>>`)
|
| 154 |
-
2. Edit to keep the correct code
|
| 155 |
-
3. Remove conflict markers
|
| 156 |
-
4. Stage the resolved files: `git add filename`
|
| 157 |
-
5. Continue: `git rebase --continue` or `git commit`
|
| 158 |
-
|
| 159 |
-
### Need to switch branches but have uncommitted changes
|
| 160 |
-
```bash
|
| 161 |
-
# Save changes for later
|
| 162 |
-
git stash
|
| 163 |
-
|
| 164 |
-
# Switch branches
|
| 165 |
-
git checkout other-branch
|
| 166 |
-
|
| 167 |
-
# Come back and restore changes
|
| 168 |
-
git checkout original-branch
|
| 169 |
-
git stash pop
|
| 170 |
-
```
|
| 171 |
-
|
| 172 |
-
---
|
| 173 |
-
|
| 174 |
-
## Notes for This Project
|
| 175 |
-
|
| 176 |
-
- **Main branch** should always be deployable
|
| 177 |
-
- Test thoroughly on feature branches before merging
|
| 178 |
-
- The persona feature includes a database migration - ensure it runs successfully before merging
|
| 179 |
-
- Breaking changes: This feature removes `customPrompts` - ensure no other code depends on it
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|