Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 1.77 KB

clone-repository.md

File metadata and controls

83 lines (57 loc) · 1.77 KB

How to clone repository

Prerequisite software

The following software programs need to be installed.

git

  1. Install Git

  2. Test

    git --version

Set environment variables for repository

⚠️ If sent here from another web page, the next two environment variables are probably set.

  1. ✏️ If not already set, set environment variables for GitHub organization/account and the name of the repository. Example:

    export GIT_ACCOUNT=senzing
    export GIT_REPOSITORY=name-of-repository
  2. Synthesize environment variables.

    export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git
    export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"

Determine URL of git repository

🤔 Git repositories can be cloned via SSH or HTTPS. For anonymous access, use HTTPS. Perform one of the following commands to set GIT_REPOSITORY_URL.

URL for HTTPS

  1. Use this example for anonymous access.

    export GIT_REPOSITORY_URL="https://github.com/${GIT_ACCOUNT}/${GIT_REPOSITORY}.git"

URL for SSH

  1. Use this example to log in with GitHub credentials.

    export GIT_REPOSITORY_URL="git@github.com:${GIT_ACCOUNT}/${GIT_REPOSITORY}.git"

Perform clone repository

  1. 🤔 Create parent directories. Choose one method.

    1. Linux. Example:

      mkdir --parents ${GIT_ACCOUNT_DIR}
    2. macOS. Example:

      mkdir -p ${GIT_ACCOUNT_DIR}
  2. Get repository. Example:

    cd  ${GIT_ACCOUNT_DIR}
    git clone  --recurse-submodules ${GIT_REPOSITORY_URL}