diff --git a/Commands.md b/Commands.md index 3eed497..c6a1be7 100644 --- a/Commands.md +++ b/Commands.md @@ -347,8 +347,8 @@ upstream git@github.com:LearnBoost/expect.js (push) ## git force-clone -If the clone target directory exists, reset its contents to a clone of the -remote. +If the clone target directory exists and is a git repository, reset its +contents to a clone of the remote. ``` bash $ git force-clone [-b {branch_name}] {remote_url} {destination_path} diff --git a/bin/git-force-clone b/bin/git-force-clone index 4b3ec0b..0f75685 100755 --- a/bin/git-force-clone +++ b/bin/git-force-clone @@ -10,7 +10,7 @@ Usage: Example: git-force-clone -b master git@github.com:me/repo.git ./repo_dir -Provides the basic functionality of 'git clone', but if the destination +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. diff --git a/man/git-force-clone.1 b/man/git-force-clone.1 index ce94f88..1f57ccf 100644 --- a/man/git-force-clone.1 +++ b/man/git-force-clone.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-FORCE\-CLONE" "1" "2016-10-28" "" "Git Extras" +.TH "GIT\-FORCE\-CLONE" "1" "2016-10-29" "" "Git Extras" . .SH "NAME" \fBgit\-force\-clone\fR \- overwrite local repositories with clone @@ -10,7 +10,7 @@ \fBforce\-clone \-\-help\fR \fBforce\-clone {remote_url} {destination_path}\fR \fBforce\-clone \-\-branch {branch_name} {remote_url} {destination_path}\fR . .SH "DESCRIPTION" -Provides the basic functionality of \fBgit clone\fR, but if the destination repository already exists it will force\-reset it to resemble a clone of the remote\. +Provides the basic functionality of \fBgit clone\fR, but if the destination git repository already exists it will force\-reset it to resemble a clone of the remote\. . .P Because it doesn\'t actually delete the directory, it is usually significantly faster than the alternative of deleting the directory and cloning the repository from scratch\. @@ -19,10 +19,10 @@ Because it doesn\'t actually delete the directory, it is usually significantly f \fBCAUTION\fR: If the repository exists, this will destroy \fIall\fR local work: changed files will be reset, local branches and other remotes will be removed\. . .SH "PROCESS" -If \fBtarget\-directory\fR doesn\'t exist then this will simply be passed through to \fBgit clone\fR, which will clone remote\. +If \fBtarget\-directory\fR doesn\'t exist or isn\'t a git repository then the arguments will simply be passed through to \fBgit clone\fR\. . .P -If \fBtarget\-directory\fR \fIdoes\fR exist then this will: +If \fBtarget\-directory\fR exists and is a git repository then this will: . .IP "\(bu" 4 Remove all remotes @@ -42,7 +42,7 @@ Delete all other local branches .IP "" 0 . .SH "OPTIONS" -\fB{remote_url}\fR \- The URL for a git remote repository of which to make a clone\. \fB{destination_path}\fR \- A path to the directory to clone into\. \fB\-\-branch {branch_name}\fR \- After cloning, checkout this branch\. +\fB{remote_url}\fR \- The URL for a git remote repository of which to make a clone\. \fB{destination_path}\fR \- A path to the local git repository location to clone into\. \fB\-\-branch {branch_name}\fR \- After cloning, checkout this branch\. . .SH "EXAMPLES" \fBgit\-force\-clone \-b master git@github\.com:me/repo\.git \./repo_dir\fR diff --git a/man/git-force-clone.html b/man/git-force-clone.html index e69de29..068b506 100644 --- a/man/git-force-clone.html +++ b/man/git-force-clone.html @@ -0,0 +1,144 @@ + + +
+ + +
+ git-force-clone - overwrite local repositories with clone
+
force-clone --help
+force-clone {remote_url} {destination_path}
+force-clone --branch {branch_name} {remote_url} {destination_path}
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.
Because it doesn't actually delete the directory, it is usually significantly +faster than the alternative of deleting the directory and cloning the +repository from scratch.
+ +CAUTION: If the repository exists, this will destroy all local work: +changed files will be reset, local branches and other remotes will be removed.
+ +If target-directory doesn't exist or isn't a git repository then the
+arguments will simply be passed through to git clone.
If target-directory exists and is a git repository then this will:
{remote_url} and fetch the remote{remote_url} - The URL for a git remote repository of which to make a clone.
+{destination_path} - A path to the local git repository location to clone into.
+--branch {branch_name} - After cloning, checkout this branch.
git-force-clone -b master git@github.com:me/repo.git ./repo_dir
Written by Robin Winslow robin@robinwinslow.co.uk.
+ +https://github.com/tj/git-extras/issues
+ +https://github.com/tj/git-extras
+ + +