Generic return codes
No error
Generic error
Requested object could not be found
Object exists preventing operation
More than one object matches
Output buffer too short to hold data
GIT_EUSER is a special error that is never generated by libgit2 code. You can return it from a callback (e.g to stop an iteration) to know that it was generated by the callback and not by libgit2.
Operation not allowed on bare repository
HEAD refers to branch with no commits
Merge in progress prevented operation
Reference was not fast-forwardable
Name/ref spec was not in a valid format
Checkout conflicts prevented operation
Lock file prevented operation
Reference value does not match expected
Authentication error
Server certificate is invalid
Patch/merge has already been applied
The requested peel operation is not possible
Unexpected EOF
Invalid operation or input
Uncommitted changes in index prevented operation
The operation is not valid for a directory
A merge conflict exists and cannot continue
A user-configured callback refused to act
Signals end of iteration with iterator
Internal only
Hashsum mismatch in object
Unsaved changes in the index would be overwritten
Patch application failed
The object is not owned by the current user
The operation timed out
There were no changes
An option is not supported
The subject is read-only