Skip to content

git_install

  GIT_PULL - pull changes to a git repository

  B = GIT_PULL(DIRNAME, REPOSITORY)

  'Install' is our term for forcing the local directory DIRNAME to match the
  remote REPOSITORY, either by cloning or pulling the latest changes. Any files
  in the local directory DIRNAME that don't match the remote REPOSITORY are deleted.

  If DIRNAME does not exist, then the repository is cloned.
  If DIRNAME exists and has local changes, the directory is deleted and cloned fresh.
  If the DIRNAME exists and has no local changes, the directory is updated by
  pulling.

  Note: if you have any local changes, GIT_INSTALL will totally remove them.

  B is 1 if the operation is successful.