Here you will find a description of a possible workflow using git with papis. This is not the only workflow, but it is the most obvious.
Let’s say you have a library named
books in the directory
~/Documents/MyNiceBooks. You could turn the
books library into
a git repository, just doing for example
papis -l books run git init
or just going to the library directory and running the command there:
cd ~/Documents/MyNiceBooks git init
Now you can add everything you have in the library with
git add .
if you are in the library’s directory or
papis -l books git add .
if you want to do it using the papis’
Interplay with other commands¶
Some papis commands give you the opportunity of using
git to manage
changes. For instance, if you are adding a new document, you could use
--commit flag to also add a commit into your library, so if you do
papis add --set author "Pedrito" --set title "Super book" book.pdf --commit
then also papis will do an automatic commit for the book, so that you can push your library afterwards to a remote repository.
You can imagine that papis commands like
mv should also
offer such functionality, and they indeed do through the
Go to their documentation for more information.
Updating the libray¶
You can use papis’ simple
papis git pull
Usually the workflow is like this:
When adding a document that you know for sure you want in your library:
Add the document and commit it, either by
git add --commitor committing the document after adding it to the library.
Pull changes from the remote library, maybe you pushed something at work (reference changes etc..) and you do not have it yet there, you would do something likepapis git pull
Push what you just addedpapis git push
Review the status of the librarypapis git status
When editing a document’s info file:
Edit the file and then take a look at the
diffpapis git diff
Add the changespapis git add --all
Commitpapis git commit
Pull/push:papis git pull papis git push
Of course these workflows are just very basic examples. Your optimal workflow could look completely different.