Syncing Papeeria project with Git repository

TL;DR

Pull changes takes new commits from <papeeria-branch> in a remote git repository and tries to merge with changes made in Papeeria. If merge completed successfully and Push changes is checked then it creates a commit and pushes it to <papeeria-branch>

See also

Git-enabled projects

When you create a new project you have an option of pulling it from git repository. Projects created this way become git-enabled and can be synced with the repository if needed. Git-enabled project is associated with a branch referred hereafter as <papeeria-branch>

 Only new projects can be git-enabled. It is not possible to link existing Papeeria project to git repository at the moment.

Use Case 1: text changes only in Papeeria

If you edit text exclusively in Papeeria and never push anything to <papeeria-branch> from other sources then you only need to push your changes. Click Sync now button in the Git section of Version Control pane and check Push changes from Papeeria. You will need to specify your name, email and commit message for the purposes of version control history; we recommend to make them meaningful. Clicking Sync will do the sync and if everything is fine you'll see the commit in the repository in a few moments

 Any user who has write access permissions to Papeeria project and write access permissions to the linked git repository can do push. Please keep in mind that SSH keys are personal, so it is necessary to authorize key of every user who needs write access to the repository.

Use Case 2: text never changes in Papeeria

You may edit the sources in other editors, commit using your favorite git tools and use Papeeria for compiling purposes only. In this use case you don't need to push changes from Papeeria, so leave only Pull changes from git checked when you run sync.

 Any user who has write access permissions to Papeeria project and read access permissions to the linked git repository can do pull. For private repositories please keep in mind that SSH keys are personal, so it is necessary to authorize key of every user who needs read access to a private repository.

Use Case 3: text changes both in Papeeria and in Git

If you both changed text in Papeeria and commited changes with your favorite text editor and git tools to <papeeria-branch> in the repository then you need to do both pull and push. We pull <papeeria-branch> first and try to merge remote changes with Papeeria changes. If merge completes successfully then we update Papeeria project. If merge fails then we leave Papeeria project intact, and you need to resolve merge conflicts manually. After successful merge you can push Papeeria changes, if any, to the same <papeeria-branch>. You can skip this step but we recommend to sync regularly.

Latest sync point

After successful sync, no matter if it was pull-only or pull and push, we record the revision hash we synced with, referred in these docs as <sync-point>. It is shown in the Git section of Version Control pane, along with the information how long ago the sync was done.