LinuxCommandLibrary

git-force-clone

Provides the basic functionality of `git clone`, but if the destination git repository already exists it will force-reset it to resemble a clone of the remote.

TLDR

Clone a Git repository into a new directory

$ git force-clone [remote_repository_location] [path/to/directory]
copy


Clone a Git repository into a new directory, checking out an specific branch
$ git force-clone -b [branch_name] [remote_repository_location] [path/to/directory]
copy


Clone a Git repository into an existing directory of a Git repository, performing a force-reset to resemble it to the remote and checking out an specific branch
$ git force-clone -b [branch_name] [remote_repository_location] [path/to/directory]
copy

Copied to clipboard