How to: Commit what was changed in Access
Bring the changes made in Access into git or svn in one step.
Solution overview
wkl-office changes shows what is not in step and the next step for each row; wkl-office diff shows the full
difference of a row. wkl-office commit checks the state again, exports the database, hands the project file, its .gitignore and the source folder to the
version control client on the PATH, and commits them. The nearest working copy above the project decides between git
and svn.
Implementation
wkl-office changes Customers.acproj wkl-office diff Customers.acproj form:frmCustomers --part code wkl-office commit Customers.acproj -m "Customer form: Phone field" wkl-office commit Customers.acproj -m "Only the customer form" source/forms/frmCustomers.form.txt wkl-office push Customers.acproj
The flow is: save in Access → check (changes) → export → review the diff → commit → push. The add-in offers the same
steps in Access (Use the Access add-in).
Remarks
- The commit is refused (exit code 7, nothing written) while a source changed outside Access waits for
import, an object changed on both sides waits for a decision, the version control reports a merge conflict, or the check failed. - The export takes the database from the Access that has it open, and refuses while something there is unsaved, naming it.
- Files the export removed (objects deleted in Access) are deleted in the version control as well.
- Passwords.
commitdoes not stop a password that exists only in the database: its check runs on the sources before the export, and the export writes queries, modules, forms and reports as they are (only the passwords of the Linked Tables Manager's connection rows are removed). Runwkl-office exportandwkl-office checkand review the diff before you commit; once a password has been committed, change it on the server. - What git receives. The commit runs
git add --all -- <paths>andgit commit -m <message> -- <paths>, where<paths>are the project file, its.gitignoreand the source root, or the files you name. Every file under the source root that git does not ignore is committed, also one you did not create with the SDK; the whole content of a path is committed, also when you staged only parts of it; other staged files of the repository stay staged. Whengit commitfails (a hook, a missing user identity), the exported files stay staged.pushrunsgit pushwithout arguments. - Subversion (preview) works through
svn.exeon the PATH forchanges,diff(against the BASE revision) andcommit;pushhas nothing to do. Use git for production work: Subversion support is a preview in this release. - Other files of the working copy are not touched: they may hold work that does not belong into this commit.
- Nothing is pushed; publishing stays the developer's decision. Subversion commits to its server by nature.
- When the sources are as committed, nothing is committed and the command says so.
- To commit only some files, name them after the project (relative to the project folder) or clear the others in the commit dialog of the add-in. The check and the export still cover every object; the files not selected stay changed for a later commit. Only files of the project can be selected.
Related topics
en/wiki/msaccess/sdk/how-to/commit-from-access.txt · Last modified: by Wolfgang van der Stille