Skip to content

Instantly share code, notes, and snippets.

@albertpark
Last active May 14, 2020 01:31
Show Gist options
  • Save albertpark/10babc28845536282b43de8268c7ab77 to your computer and use it in GitHub Desktop.
Save albertpark/10babc28845536282b43de8268c7ab77 to your computer and use it in GitHub Desktop.

Clone into a Non Empty Directory

Navigate to the desired directory you wish to work on and type the following commands in a terminal.

$ git init
$ git remote add origin PATH_TO_REPOSITORY # i.e. git@github.com:username/repository-name.git
$ git fetch origin
$ git reset origin/master  # Required when the versioned files existed in path before "git init" of this repo.
$ git checkout -t origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment