Branches and Pull Requests
Copy a prompt, paste it into NocoAI in a factory session, and replace the words in [brackets] with your own.
- Commit the changes and push the branch
- Open a pull request for this branch, with a summary of the changes
- Read the review comments on [pull request #123] and fix them
- Rebase this branch on [main] and fix the conflicts
Each Noco Factory session works on its own git branch. NocoAI commits and pushes only when you ask it to. When the work is ready, ask NocoAI to open a pull request on GitHub. You review and merge the pull request in GitHub, as you do for any other change.
Which branch a session uses
The source that you pick when you start a session sets the branch:
| Source | Branch that the session works on |
|---|---|
| Nothing picked, or the default branch | A new branch from the default branch |
| An issue | A new branch from the default branch |
| A pull request | A new branch from the head of the pull request |
| A branch other than the default | That branch |
New branches are named nocodb-factory/[name]. A session never works on the default branch directly.
The Environment menu
The Environment menu in the session header shows the state of the session's code:
| Item | What it shows or does |
|---|---|
| Changes | The number of lines added and removed in the session. See Review changes. |
| Machine name | The machine of the session. Opens it in the factory settings. |
| Branch name | The branch of the session. |
| Commit or push | Asks NocoAI to commit the changes and push the branch. |
| Compare branch | Opens the GitHub compare page for the branch. |

Commit and push
NocoAI does not commit or push on its own. To save the work to GitHub, do one of these:
- Click Commit or push in the Environment menu or in the Changes tab. NocoAI gets the message "Commit the changes and push the branch.".
- Ask in the chat, for example "Commit this with the message [message] and push".
NocoAI commits as the NocoDB App Factory bot, and pushes the branch to the factory's repository.
Open a pull request
- Ask NocoAI to open a pull request, for example "Open a pull request for this branch".
- NocoAI pushes the branch if needed, and opens the pull request against the default branch.
- The session header shows a chip with the number of the pull request, for example #123. Click it to open the pull request in GitHub.
The chip shows the state of the pull request:
| Color | State |
|---|---|
| Grey | Open |
| Purple | Merged |
| Red | Closed |

Work on an existing pull request
To have NocoAI review or change an open pull request, start a new session from the pull request. Pick it in the source chip, or click Review on it in the From the repo list.
The session checks out the pull request on a new nocodb-factory/[name] branch. When NocoAI pushes, it pushes that new branch, not the branch of the pull request.
Good to know
- NocoAI can push only to the branch of its session. It cannot push to the default branch.
- The factory never pushes to a fork.
- The pull request chip updates when NocoAI finishes a reply.
Related
Last updated on