Should I commit `.ledger` dir
I am using xata in a node js framework. Should I be committing the
.ledger
folder to git?2 Replies
Hello, it is recommended to commit the entire .xata folder with all its content, including the .xata/migrations/.ledger file.
The ledger file is used for avoiding branch merging conflicts. It stores the migration file names in the correct linear order to be applied.
The information under the .xata directory is needed for local development and for use with the GitHub + Vercel/Netlify integration (Beta) https://xata.io/docs/getting-started/workflow#migrations-with-github. Note that for an end user to clone and run your app from github, they wouldn't need the .xata directory. This is needed for anyone who develops and performs migrations on your Xata database.
A general hint, for the purpose of sharing app code with others via a public repo to use with their own Xata databases, we recommend committing your schema file (
xata schema dump
) and suggest in the readme to users cloning your repo that they should do xata init --schema schema.json
or xata schema upload schema.json
with your schema file, which will set their db to use the exact same schema as yours. This will also generate the .xata directory, .xatarc and src/xata.ts file for them, for their own database URL.Sounds good. Thank you @kostas