Functions
2.1 Annotated Commit
2.2 Blame
2.3 Blob
2.4 Branch
2.5 Buffer
2.6 Checkout
2.7 Cherrypick
2.8 Clone
2.9 Commit
2.10 Config
2.11 Credentials
2.12 Describe
2.13 Diff
2.14 Fetch
2.15 Filter
2.16 Errors
2.17 Graph
2.18 Ignore
2.19 Index
2.20 Indexer
2.21 Global
2.22 Merge
2.23 Message
2.24 Note
2.25 Object
2.26 Object Database
2.27 Oid
2.28 Oid Array
2.29 Packbuilder
2.30 Patch
2.31 Pathspec
2.32 Proxy
2.33 Push
2.34 Rebase
2.35 Refdb
2.36 Reference
2.37 Reflog
2.38 Refspec
2.39 Remote
2.40 Repository
2.41 Reset
2.42 Revert
2.43 Revparse
2.44 Revwalk
2.45 Signature
2.46 Stash
2.47 Status
2.48 Strarray
2.49 Submodule
2.50 Tag
2.51 Tree
2.52 Treebuilder
On this page:
git_  cred_  default_  new
git_  cred_  free
git_  cred_  has_  username
git_  cred_  ssh_  custom_  new
git_  cred_  ssh_  interactive_  new
git_  cred_  ssh_  key_  from_  agent
git_  cred_  ssh_  key_  memory_  new
git_  cred_  ssh_  key_  new
git_  cred_  username_  new
git_  cred_  userpass
git_  cred_  userpass_  plaintext_  new
7.7

2.11 Credentials

 (require libgit2/include/cred) package: libgit2

procedure

(git_cred_default_new)  cred?

Create a "default" credential usable for Negotiate mechanisms like NTLM or Kerberos authentication.

procedure

(git_cred_free cred)  void?

  cred : cred?
Free a credential.

This is only necessary if you own the object; that is, if you are a transport.

procedure

(git_cred_has_username cred)  boolean?

  cred : cred?
Check whether a credential object contains username information.

procedure

(git_cred_ssh_custom_new username    
  publickey    
  publickey_len    
  sign_callback    
  payload)  cred?
  username : string?
  publickey : string?
  publickey_len : integer?
  sign_callback : git_cred_sign_callback
  payload : bytes?
Create an ssh key credential with a custom signing function.

This lets you use your own function to sign the challenge.

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_interactive_new username    
  prompt_callback    
  payload)  cred?
  username : string?
  prompt_callback : git_cred_ssh_interactive_callback
  payload : bytes?
Create a new ssh keyboard-interactive based credential object. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_key_from_agent username)  cred?

  username : string?
Create a new ssh key credential object used for querying an ssh-agent. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_key_memory_new username    
  publickey    
  privatekey    
  passphrase)  cred?
  username : string?
  publickey : string?
  privatekey : string?
  passphrase : string?
Create a new ssh key credential object reading the keys from memory.

procedure

(git_cred_ssh_key_new username    
  publickey    
  privatekey    
  passphrase)  cred?
  username : string?
  publickey : string?
  privatekey : string?
  passphrase : string?
Create a new passphrase-protected ssh key credential object. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_username_new username)  cred?

  username : string?
Create a credential to specify a username.

This is used with ssh authentication to query for the username if none is specified in the url.

procedure

(git_cred_userpass url    
  user_from_url    
  allowed_types    
  payload)  cred?
  url : string?
  user_from_url : string?
  allowed_types : integer?
  payload : bytes?
Stock callback usable as a git_cred_acquire_cb. This calls git_cred_userpass_plaintext_new unless the protocol has not specified GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

procedure

(git_cred_userpass_plaintext_new username    
  password)  cred?
  username : string?
  password : string?
Create a new plain-text username and password credential object. The supplied credential parameter will be internally duplicated.