Codify
git

git-repository

A reference page for the git-clone resource

This resource was named git-clone in version 0.12 and below of the Codify core plugin

The Git repository resource reference. This resource will allow Codify to clone repos from any git remote (Github, Bitbucket, GitLab, etc...)

Parameters:

  • repository: (string) The repository url. This can be any url supported by git clone (ssh, https, ftp).

  • remote: (string) The remote url. This can be any url supported by git clone (ssh, https, ftp). (removed in version 0.7.0 use repository instead)

  • directory: (string) The directory to git clone into. Note that a nested folder will not be created and files from the root level of the git repository will be copied into the directory. Use the parentDirectory parameter instead to specify the parent directory to clone into. Equivalent to using the <directory> option of git clone. Both relative and absolute paths work.

  • parentDirectory: (string) The parent directory to clone into. This option will call git clone within the parent directory and create a folder name using the last part of the git url (ex: repo for /path/to/repo.git).

Example usage:

codify.json
[
  {
    "type":  "git-repository",
    "parentDirectory": "~/projects",
    "remote": "git@github.com:kevinwang5658/codify-plugin-lib.git"
  },
  {
    "type":  "git-repository",
    "directory": "~/projects/npm",
    "repository": "https://github.com/npm/npm.git"
  }
]

Setting up Github ssh and clone a repo

Starter instructions for setting up Github SSH and cloning a repo.

Generate a ssh key and start the ssh-agent.
terminal
ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
Create a ssh config if it doesn't exist
terminal
touch ~/.ssh/config
Open the ~/.ssh/config file with your favourite text editor and add the following. If a custom identity file name was used. Substitute ~/.ssh/id_ed25519 with your custom name.
Host github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519
Add ssh key to your keychain
terminal
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Copy the ssh public key to your clipboard.
terminal
pbcopy < ~/.ssh/id_ed25519.pub
Login to your github account online and paste the public key under Settings > SSH and GPG keys > New SSH Key. More detailed instructions can be found on github
For every repo you want to clone get the SSH url under the Code drop down on the home page of a repository
Copy the url into your codify.json file and use codify apply to clone the repo.
codify.json
[
  {
    "type":  "git-repository",
    "parentDirectory": "~/projects",
    "remote": "git@github.com:kevinwang5658/codify-plugin-lib.git"
  }
]

On this page