git lfs api

本文详细解析了Git LFS API如何利用gitcredential访问API用户名和密码,特别针对SSH认证流程进行了深入探讨,包括如何在git远程匹配时避免重复输入密码,以及SSH路径、操作类型和对象ID在git-lfs-authenticate命令中的应用。同时,文章还解释了当SSH认证失败时的错误输出及未来版本中可能改进的缓存策略。

The Git LFS API uses git credentials to access the API username and password. If the Git LFS domain matches the Git remote's, Git LFS will not prompt you again to enter the password. git lfs api 使用git credential 来访问api的用户名和密码。如果git lsf domain 和git的远端匹配,git lfs 将不会要求你再次输入密码。

If the Git remote is using SSH, Git LFS will execute the git-lfs-authenticate command. It passes the SSH path, the Git LFS operation (upload or download), and the object OID as arguments. A successful result outputs a JSON link object to STDOUT. This is applied to any Git LFS API request before git credentials are accessed.

如果gir 远端 使用ssh , git lfs 将执行 git-lfs-authenticate 命令。 他传递 ssh 路径, git lfs 上传和下载时使用 ojbect oid 作为参数。 如果成功将在stdout中输出 json 信息。这将在git lfs api 请求的时候在 git credentials 通过之前执行。

# remote: git@github.com:user/repo.git
$ ssh git@github.com git-lfs-authenticate user/repo.git download {oid}
{
  "header": {
    "Authorization": "Basic ..."
  }
  // OPTIONAL key only needed if the Git LFS server is not hosted at the default
  // URL from the Git remote:
  //   https://github.com/user/repo.git/info/lfs
  "href": "https://other-server.com/user/repo",
}

上面是反馈信息

If Git LFS detects a non-zero exit status, it displays the command's STDERR: 如果git lfs 检查到一个 non-zero 的状态, 他将显示为:

$ ssh git@github.com git-lfs-authenticate user/repo.git wat {oid}
Invalid LFS operation: "wat"

NOTE: The Git LFS client currently does not cache the headers from the SSH command. This is being considered for a future release.

注意当前版本的git lfs 客户端 不缓存 ssh 命令的headers . 以后的版本将会考虑加入

转载于:https://my.oschina.net/zsjasper/blog/424663

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值