From 739ca052b4e4096b15fcdf3b925e783ce4a56b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Thu, 19 Mar 2020 16:10:20 +0100 Subject: [PATCH] Add documentation. --- Commands.md | 9 ++++ etc/bash_completion.sh | 4 ++ man/git-cp.1 | 24 +++++++++ man/git-cp.html | 114 +++++++++++++++++++++++++++++++++++++++++ man/git-cp.md | 30 +++++++++++ 5 files changed, 181 insertions(+) create mode 100644 man/git-cp.1 create mode 100644 man/git-cp.html create mode 100644 man/git-cp.md diff --git a/Commands.md b/Commands.md index 3c31168..b18f5a4 100644 --- a/Commands.md +++ b/Commands.md @@ -15,6 +15,7 @@ - [`git commits-since`](#git-commits-since) - [`git contrib`](#git-contrib) - [`git count`](#git-count) + - [`git cp`](#git-cp) - [`git create-branch`](#git-create-branch) - [`git delete-branch`](#git-delete-branch) - [`git delete-merged-branches`](#git-delete-merged-branches) @@ -786,6 +787,14 @@ If you wish to omit the config section, you may use `--no-config`: $ git info --no-config ``` +## git cp + +Copy a file to another one keeping its history and allowing for merge conflits handling. + +```bash +$ git cp README.md README.rst +``` + ## git create-branch Create local branch `name`: diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh index 78343bf..0bf2975 100644 --- a/etc/bash_completion.sh +++ b/etc/bash_completion.sh @@ -49,6 +49,10 @@ _git_count(){ __gitcomp "--all" } +__git_cp(){ + __git_complete_file +} + _git_delete_branch(){ __gitcomp "$(__git_heads)" } diff --git a/man/git-cp.1 b/man/git-cp.1 new file mode 100644 index 0000000..7a48c93 --- /dev/null +++ b/man/git-cp.1 @@ -0,0 +1,24 @@ +.\" generated with Ronn-NG/v0.8.0 +.\" http://github.com/apjanke/ronn-ng/tree/0.8.0 +.TH "GIT\-CP" "1" "March 2020" "" "" +.SH "NAME" +\fBgit\-cp\fR \- Copy a file keeping its history +.SH "SYNOPSIS" +\fBgit\-cp\fR +.SH "DESCRIPTION" +Copy a file keeping its git history\. This allow merge conflict handling\. +.SH "EXAMPLES" +Copy README into README\.txt +.IP "" 4 +.nf +$ git cp README README\.txt +.fi +.IP "" 0 +.SH "AUTHOR" +Written by Rémy Hubscher <\fI\%mailto:hubscher\.remy@gmail\.com\fR> +.SH "REPORTING BUGS" +<\fI\%https://github\.com/tj/git\-extras/issues\fR> +.SH "SEE ALSO" +<\fI\%https://github\.com/tj/git\-extras\fR> +.P +<\fI\%https://stackoverflow\.com/questions/16937359/git\-copy\-file\-preserving\-history/44036771#44036771\fR> diff --git a/man/git-cp.html b/man/git-cp.html new file mode 100644 index 0000000..31de9ee --- /dev/null +++ b/man/git-cp.html @@ -0,0 +1,114 @@ + + + + + + git-cp(1) - Copy a file keeping its history + + + + +
+ + + +
    +
  1. git-cp(1)
  2. +
  3. +
  4. git-cp(1)
  5. +
+ + + +

NAME

+

+ git-cp - Copy a file keeping its history +

+

SYNOPSIS

+ +

git-cp <current_filename> <destination_filename>

+ +

DESCRIPTION

+ +

Copy a file keeping its git history. This allow merge conflict handling.

+ +

EXAMPLES

+ +

Copy README into README.txt

+ +
$ git cp README README.txt
+
+ +

AUTHOR

+ +

Written by Rémy Hubscher <hubscher.remy@gmail.com>

+ +

REPORTING BUGS

+ +

<https://github.com/tj/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/tj/git-extras>

+ +

<https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history/44036771#44036771>

+ +
    +
  1. +
  2. March 2020
  3. +
  4. git-cp(1)
  5. +
+ +
+ + diff --git a/man/git-cp.md b/man/git-cp.md new file mode 100644 index 0000000..ed05fe8 --- /dev/null +++ b/man/git-cp.md @@ -0,0 +1,30 @@ +git-cp(1) -- Copy a file keeping its history +============================================ + +## SYNOPSIS + +`git-cp` <current_filename> <destination_filename> + +## DESCRIPTION + +Copy a file keeping its git history. This allow merge conflict handling. + +## EXAMPLES + + Copy README into README.txt + + $ git cp README README.txt + +## AUTHOR + +Written by Rémy Hubscher <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> + +<>