Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何签出git子模块以进行Point-to-sale Git子模_Git_Square Connect - Fatal编程技术网

如何签出git子模块以进行Point-to-sale Git子模

如何签出git子模块以进行Point-to-sale Git子模,git,square-connect,Git,Square Connect,使用git submodule add签出子模块git@github.com:Square/SquarePointOfSaleSDK iOS.git,将SquarePointOfSaleSDK.xcodeproj拖动到项目中,并将SquarePointOfSaleSDK添加为生成依赖项 我目前正在将SDK添加到我的Xcode项目中,但当我在终端中键入该命令时,出现以下错误: Permission denied (publickey). fatal: Could not read from rem

使用
git submodule add签出子模块git@github.com:Square/SquarePointOfSaleSDK iOS.git
,将SquarePointOfSaleSDK.xcodeproj拖动到项目中,并将SquarePointOfSaleSDK添加为生成依赖项

我目前正在将SDK添加到我的Xcode项目中,但当我在终端中键入该命令时,出现以下错误:

Permission denied (publickey).
fatal: Could not read from remote repository.
请确保您拥有正确的访问权限 并且存储库存在


我做错了什么?我对移动开发相当陌生。

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

选择任意编辑器,执行以下操作:

方法1,替换旧的SSH密钥
nano~/.ssh/your_key.pub
之后,复制ssh密钥并删除未使用的旧ssh密钥

添加新的ssh密钥,然后
git子模块更新--init--recursive


方法2,为SSH密钥提供权限 在本例中,使用回购的所有用户都添加到同一组中。他们每个人都有读写的权利

为了授予访问权限,您需要使用
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子模块更新--init--recursive

Square也应该使用
https
版本而不是ssh,这样会更容易。您可以替换
git@github...
https://github.com/square/SquarePointOfSaleSDK-iOS.git
如果您不想设置ssh。我现在就向回购协议提出请求。