Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

git-mv(1) [linux man page]

GIT-MV(1)							    Git Manual								 GIT-MV(1)

NAME
git-mv - Move or rename a file, a directory, or a symlink SYNOPSIS
git mv <options>... <args>... DESCRIPTION
Move or rename a file, directory or symlink. git mv [-v] [-f] [-n] [-k] <source> <destination> git mv [-v] [-f] [-n] [-k] <source> ... <destination directory> In the first form, it renames <source>, which must exist and be either a file, symlink or directory, to <destination>. In the second form, the last argument has to be an existing directory; the given sources will be moved into this directory. The index is updated after successful completion, but the change must still be committed. OPTIONS
-f, --force Force renaming or moving of a file even if the target exists -k Skip move or rename actions which would lead to an error condition. An error happens when a source is neither existing nor controlled by Git, or when it would overwrite an existing file unless -f is given. -n, --dry-run Do nothing; only show what would happen -v, --verbose Report the names of files as they are moved. SUBMODULES
Moving a submodule using a gitfile (which means they were cloned with a Git version 1.7.8 or newer) will update the gitfile and core.worktree setting to make the submodule work in the new location. It also will attempt to update the submodule.<name>.path setting in the gitmodules(5) file and stage that file (unless -n is used). GIT
Part of the git(1) suite Git 1.8.5.3 01/14/2014 GIT-MV(1)

Check Out this Related Man Page

GIT-MV(1)							    Git Manual								 GIT-MV(1)

NAME
git-mv - Move or rename a file, a directory, or a symlink SYNOPSIS
git mv <options>... <args>... DESCRIPTION
This script is used to move or rename a file, directory or symlink. git mv [-f] [-n] <source> <destination> git mv [-f] [-n] [-k] <source> ... <destination directory> In the first form, it renames <source>, which must exist and be either a file, symlink or directory, to <destination>. In the second form, the last argument has to be an existing directory; the given sources will be moved into this directory. The index is updated after successful completion, but the change must still be committed. OPTIONS
-f, --force Force renaming or moving of a file even if the target exists -k Skip move or rename actions which would lead to an error condition. An error happens when a source is neither existing nor controlled by GIT, or when it would overwrite an existing file unless -f is given. -n, --dry-run Do nothing; only show what would happen AUTHOR
Written by Linus Torvalds <torvalds@osdl.org[1]> Rewritten by Ryan Anderson <ryan@michonline.com[2]> Move functionality added by Josef Weidendorfer <Josef.Weidendorfer@gmx.de[3]> DOCUMENTATION
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org[4]>. GIT
Part of the git(1) suite NOTES
1. torvalds@osdl.org mailto:torvalds@osdl.org 2. ryan@michonline.com mailto:ryan@michonline.com 3. Josef.Weidendorfer@gmx.de mailto:Josef.Weidendorfer@gmx.de 4. git@vger.kernel.org mailto:git@vger.kernel.org Git 1.7.1 07/05/2010 GIT-MV(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move and rename files in seq. with padded digits

Greetings, I am new to scripting, but find if I can see the code working for a given problem, then I can eventually figure it out. (9 Replies)
Discussion started by: rocinante
9 Replies

2. UNIX for Dummies Questions & Answers

Multiple file renaming

Hi All, I have a number of files in a directory that I would like to rename - I am quite aware that you can use the mv command to rename the files - I would like to rename them automatically from the command line instead of having to do them singly. I have searched the forum pertaining to... (4 Replies)
Discussion started by: BigTool4u2
4 Replies

3. UNIX for Advanced & Expert Users

renaming files

How can I rename files with .c to .cpp in my current directory and if any directory present in current directory system should descend in to that and checks ( find ).... tell me how to achieve this using find command and other if any? thanks. (7 Replies)
Discussion started by: shahnazurs
7 Replies

4. UNIX for Dummies Questions & Answers

rename multiple files from search output

Variations of multiple renames seems to come up a lot but i can't find the answer to this situation. Tidying up a directory where people rename files to .working, .bob, .attempt1 & so on. what i am trying to do is: list the file type, & rename from ".whatever" to .fixed. As the ".whatever" is... (5 Replies)
Discussion started by: woodstock
5 Replies

5. UNIX for Dummies Questions & Answers

Move Script

Hi I am very new to scripts and only have a basic knowledge What i am trying to do is move files from one directory to another, but i need to make sure the file is stable before it moves the file to the destination. Here is the script that i am using that is moving the files, it part of a script... (8 Replies)
Discussion started by: treds
8 Replies

6. Shell Programming and Scripting

rename direcories recusively

Hi everone I need to rename my directory tree. I want to define the renaming by regular expressions so i am free to what ever I like to do. how would I rename an path like this one: /thE/Long/patH-tO/my.litte/filE.TxT to /the/long/path_to/my_little/file.txt I tried this one, but... (8 Replies)
Discussion started by: latenite
8 Replies

7. UNIX for Advanced & Expert Users

Getting real path to directory

Hi friends, Need your help. The question is: 1) We have directory '/SomeDirectory/SubDirectory' 2) And have symlink pointing to it like '/AnotherOneDirectory/symlink' '/AnotherOneDirectory/symlink' -> '/SomeDirectory/SubDirectory' 3) Need to get real path without symlinks knowing only... (7 Replies)
Discussion started by: kandrewo
7 Replies

8. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

9. UNIX for Dummies Questions & Answers

renaming all files

requirement: There are many files inside a directory and all are named like this "out_1". The file names goes on itearation like out_2, out_3 etc.... Now i want to rename all the file names based on the text inside the file. the text in all the files follow a pattern like it satrts... (4 Replies)
Discussion started by: arunmanas
4 Replies

10. Shell Programming and Scripting

How to rename a file with a name from another file

Hello Experts... I have a requirement to rename a file using the file name stored in another file. I browsed thru forums and found this for renaming multiple files. awk '{f=$1;sub("-.*\\.","_"$2".",$1);system("mv "f" "$1)}' file-with-filenames But, My requirement is to rename a... (6 Replies)
Discussion started by: ekrish
6 Replies

11. Shell Programming and Scripting

Copy or Move problem

Hi All, I have a simple shell script to move .txt file(s) from a source directory one after another to the destination. The source directory is shared to windows using samba. The source files are arriving continuously and approx size is 10-15 KB. Some time the file size reached upto 100 KB and... (9 Replies)
Discussion started by: sraj142
9 Replies

12. UNIX for Dummies Questions & Answers

question in MV command (will move work with 100% used directory)

Dear all, I am facing a issue in MV command, this move is done by our c program. We are moving the file to same directory so basically I think it will be a rename of the inode. So we might not useany extra space then why the move is failing. Does it require space to move the same size of file... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

13. UNIX for Dummies Questions & Answers

How to "clone" a directory and it's symlink?

Hi all, Am trying to make a backup of a directory to move it to a new directory 'coz I need to do a re-install of a software. On Linux, I can do cp -rpH but not on Solaris? Example is as below: ls -l dir1 total 0 -rw-r----- 1 oracle dba 0 Aug 9 13:08 fil3.txt... (9 Replies)
Discussion started by: newbie_01
9 Replies

14. UNIX for Dummies Questions & Answers

Move all files one directory level up

(10 Replies)
Discussion started by: ftrobaugh
10 Replies

15. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies