简体   繁体   中英

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.

I am currently at this step of adding the SDK to my Xcode project but when I type that command into my terminal I get this error:

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

Please make sure you have the correct access rights and the repository exists.

What am I doing wrong? I am fairly new to mobile development.

This is the very classical issue when you do not have right privileges to your ssh key or your ssh key is old. It won't let you add repo as the submodule or clone the repo.

Pick any editor of your choice, do these following,

Method 1, Replace old SSH key

nano ~/.ssh/your_key.pub after that copy the ssh key and remove the old ssh keys not used.

Add your new ssh key and then git submodule update --init --recursive


Method 2, Providing privileges to SSH key

In this case check, all the users who are utilising the repo are added in the same group. And each of them has granted rights to read and write.

In order to grant access rights, you need to use CHMOD utility.

List of chmod commands.

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 

After setting the correct privileges then you can do git submodule update --init --recursive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM