Merge dev branch to main branch
Hello, I'm currently working on some project and I need to merge my changes n my dev branch to our main for production release. I wanted to know on how to do it?
2 Replies
Hi kayog! The most straightforward way to do this is via the xata cli and the
push
command. This applies local migration files to a target branch.
As an example, I made a small python project and did the following:
1. Made a new branch on my db.
2. Made sure my local project was up to date with main then edited my .env file to use the new branch.
3. Added a new table. This creates a migration file on the new branch.
4. Used xata push main
to push the changes made to my dev branch to main. You can run xata branch diff
to view the differences between your main branch and your dev branch. You can also use the --dry-run
option to check which migration files will be applied.
https://xata.io/docs/getting-started/cli#push
You may also find the following doc helpful:
https://xata.io/docs/getting-started/workflow#merge-your-prI try pushing using the cli but got this 'There are new migrations both locally and in the remote branch'. When I try to pull my dev branch and push to main. Not sure why it is not letting me