git force-clone
Provides the basic functionality ofgit clone
, but if the destination git repository already exists it will force-reset it to resemble a clone of the remote. Part ofgit-extras
. More information: https://github.com/tj/git-extras/blob/master/Commands.md#git-force-clone.
-
Clone a Git repository into a new directory:
git force-clone {{remote_repository_location}} {{path/to/directory}}
-
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}}
-
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}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.