git lfs api

原创
2015/06/04 11:14
阅读数 333

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 . 以后的版本将会考虑加入

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部