TL; DR: read-write sync between Papeeria project and Git repository
Git sync
We're enhancing our Git integration which was first announced in April and allowed for importing Git repository when creating a new Papeeria project. Today we're launching new synchronization features which enable rich git workflow: pull, checkout, branch, merge and push. Git sync is available to both free and paying users, except that
some restrictions apply to free users.
Working with Git from Papeeria
I created a new project from
our clone of
Deedy resume hosted on GitHub and
Git section in the
Version Control pane shows me some information.
|
Git section in the Version Control pane |
You can see repository URL, name of the branch and the last revision I synced with.
Pushing changes from Papeeria into the repository
I added a new empty file and now I am going to submit it to the repository. Clicking
Sync now button in the Version Control pane opens
Git Sync dialog where I can pull the changes from repository and optionally push my changes. However, I need to
setup my credentials to be able to push. GitHub uses SSH public key for authorization, so I copy my public key from
SSH key section in the dialog and paste it into my account on GitHub.
|
Don't forget to authorize SSH key on your git hosting |
Now I can push, and it completes successfully.
Merging changes
I added a few more lines and at the same time my colleague who prefers to work offline cloned the repository on his laptop, changed some lines in his favorite TeX editor, committed the changes and pushed to the repository. We're both using the same branch and I have to pull his changes into Papeeria and merge them with my work. I open Git Sync dialog, pull the changes and merge completes fine as we didn't touch the same lines.
Merge conflict
However, when it comes to merging we're not always that lucky. Now we both have changes the same line and my attempt to sync failed with merge conflict.
|
It happens |
Project in Papeeria remains intact when merge fails so if I was not in the mood to resolve the conflict I would've just continued my work and merged later. But I don't mind resolving the conflict so I click
Start resolving.
Papeeria suggests committing my work into a temporary branch -- that's cool because it allows me to commit and push my updates immediately without waiting for merge.
|
Commit into a new temporary branch before merging |
Now I need to do the merge and I realize it requires running an external git client. I decide to enjoy a cup of coffee before digging into the command line and I close the dialog. Papeeria shows me a reminder about the ongoing merge in the Version Control pane.
|
Reminder indicates that you had a merge conflict |
In a dozen of minutes I get back to Papeeria and click
Resume resolving. Merge dialog shows me a few commands which I have to run.
git clone, checkout, merge, edit the conflicts in the text editor,
git add, commit, push... done! I've merged the changes and pushed them back to
papeeria-edition branch which I had been synced with before the conflict happened. I proceed to the third step and switch to
papeeria-edition branch again.
|
The final step of resolving: return back to the working branch |
|
The final history of changes |
Things to keep in mind
- Only newly created project can be git-enabled.
- Users subscribed to free Epsilon pricing plan can only pull and push to public repositories hosted on GitHub, Bitbucket, GitLab and Assembla.
- If you plan to push from Papeeria to Git repo, use SSH protocol and authorize your public key.
- Merging in case of conflicts requires using external git tools.
Have fun with Git and do no hesitate to
contact us in case of any troubles!