From 3839223635b93261a5696eb28945db17535e4bed Mon Sep 17 00:00:00 2001 From: Igor Shubovych Date: Thu, 17 Dec 2015 23:22:16 +0200 Subject: [PATCH] git-mv: add page --- pages/common/git-mv.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/common/git-mv.md diff --git a/pages/common/git-mv.md b/pages/common/git-mv.md new file mode 100644 index 000000000..6fa5ec881 --- /dev/null +++ b/pages/common/git-mv.md @@ -0,0 +1,15 @@ +# git mv + +> Move or rename files and update the git index. + +- Move file inside the repo and add the movement to the next commit + +`git mv {{path/to/file}} {{new/path/to/file}}` + +- Rename file and add renaming to the next commit + +`git mv {{filename}} {{new_filename}}` + +- Overwrite the file in the target path if it exists + +`git mv --force {{file}} {{target}}`