我如何结帐 git 个子模块以用于销售点

How do i checkout a git submodules for Point-to-sale

Git Submodules

Checkout the submodule with git submodule add git@github.com:Square/SquarePointOfSaleSDK-iOS.git, drag SquarePointOfSaleSDK.xcodeproj to your project, and add SquarePointOfSaleSDK as a build dependency.

我目前正处于将 SDK 添加到我的 Xcode 项目的这一步,但是当我在我的终端中键入该命令时,我收到此错误:

Permission denied (publickey).
fatal: Could not read from remote repository.

请确保您拥有正确的访问权限 并且存储库存在。

我做错了什么?我对移动开发还很陌生。

当您没有正确的 ssh 密钥权限或您的 ssh 密钥旧时,这是一个非常典型的问题。它不会让您将 repo 添加为子模块或克隆 repo。

选择您选择的任何编辑器,执行以下操作,

方法一,替换旧的SSH密钥

nano ~/.ssh/your_key.pub 之后复制 ssh 密钥并删除未使用的旧 ssh 密钥。

添加新的 ssh 密钥,然后 git submodule update --init --recursive


方法二,给SSH key提供权限

在这种情况下检查,所有使用 repo 的用户都被添加到同一组中。并且每个人都授予了读写权限。

为了授予访问权限,您需要使用 CHMOD 实用程序。

chmod 命令列表。

chmod -R 777 /var/www (setting the permission recursively)
chmod a-w file (removes all writing permissions)
chmod o+x file (sets execute permissions for other (public permissions))
chmod u=rx file        (Give the owner rx permissions, not w)
chmod go-rwx file      (Deny rwx permission for group, others)
chmod g+w file         (Give write permission to the group)
chmod a+x file1 file2  (Give execute permission to everybody)
chmod g+rx,o+x file    (OK to combine like this with a comma)

u = user that owns the file
g = group that owns the file
o = other (everyone else)
a = all (everybody)

r = read aces to the file
w = write access
x = execute (run) access 

设置正确的权限后就可以git submodule update --init --recursive