Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

git-mv(1) [debian 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 [-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. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 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
       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).

BUGS
       Each time a superproject update moves a populated submodule (e.g. when switching between commits before and after the move) a stale
       submodule checkout will remain in the old location and an empty directory will appear in the new location. To populate the submodule again
       in the new location the user will have to run "git submodule update" afterwards. Removing the old directory is only safe when it uses a
       gitfile, as otherwise the history of the submodule will be deleted too. Both steps will be obsolete when recursive submodule update has
       been implemented.

GIT
       Part of the git(1) suite

Git 2.17.1							    10/05/2018								 GIT-MV(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rename multiple files

Hi, can anyone have a ksh script to rename multiple files (ie to remove .Z extension of the files) can someone correct this? for i in *.Z do var1 = substr($i, 1,at(".Z",$i)-1) mv $i $var1 done Thanks.. Antony (13 Replies)
Discussion started by: antointoronto
13 Replies

2. Shell Programming and Scripting

rename a lot of files again

here I go again...kinda hard to explain so I apologize. I need to rename a bunch of files in a directory. I need to remove the first three characters of the filename, and then toward the end of the filename there is constant text inside of brackets. here is a demo (not for real) 'ls -1' of the... (11 Replies)
Discussion started by: ajp7701
11 Replies

3. Shell Programming and Scripting

file renaming

How can I rename files named like these iq - 000001 - 2008.07.31 - 14.49.47 - location1.bin iq - 000001 - 2008.07.31 - 14.49.47 - location12.bin iq - 000008 - 2008.07.31 - 14.52.01 - location500.bin to iq_2008.07.31_14.49.47_location1.bin iq_2008.07.31_14.49.47_location12.bin... (7 Replies)
Discussion started by: larne
7 Replies

4. Shell Programming and Scripting

Need to move and rename a list of files

Hi, I need to do something easy but I can't seem to figure out how to do this. Let's say I have 6 files in the directory below: /ebsbeta_f/flash/EBSUATQB/onlinelog o1_mf_6_55klt7nr_.log o1_mf_3_55klskj4_.log o1_mf_4_55klsrl1_.log o1_mf_5_55klt09p_.log o1_mf_2_55klv1ts_.log... (10 Replies)
Discussion started by: exm
10 Replies

5. 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

6. Shell Programming and Scripting

Copying files and renaming

The goal is to read names of files defined ouside in upload.conf and rename them using date, time and proper extension. I have made short script while read; do cp "$RELAY" "$RELAY(date +%Y-%m-%d_%H:%M:%S)_DEPLOYED.ear" done < upload.conf but unfortunatelly it fails printiong the... (9 Replies)
Discussion started by: Michal Janusz
9 Replies

7. 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

8. 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

9. Shell Programming and Scripting

[SOLVED] moving multiple files? mv

HI I have a list of files that are incorrectely names and I need to move them to new name .. I tried few things that has not worked so far can you help ? I need to rename all thes eifle ( tere are over 100 ) xldn0357bap.orig.new xldn0389bap.orig.new xldn0439bap.orig.new... (12 Replies)
Discussion started by: mnassiri
12 Replies

10. Shell Programming and Scripting

Renaming multiple files in a directory

Hello, I would like to rename all available files in a directory from Filename to Filename_Normal. I tried to use below script but it is giving some error: #!/bin/sh for i in `ls` do echo Changing $i mv $i $i_Normal done Error received: Usage: mv src target or: mv ... (10 Replies)
Discussion started by: manishdivs
10 Replies

11. Ubuntu

Creating conditional symlink

Hi All, Is there any way to create a symlink that will point to last 1000 line of a log file. My symlink will always point to "tail -1000 logfile". This can be achieved by writing a script and scheduling with high frequency, but I am looking for some other alternatives. Please let me know... (8 Replies)
Discussion started by: sussus2326
8 Replies

12. Shell Programming and Scripting

How to rename multiple file names?

Hi all, I need to rename more file name in one command or script. The files have this structure: XxY - filename.doc where X and Y are numbers and the x is the letter itself. I need to rename these files with this structure: string.S0XEY.filename.doc the string is a suffix that... (8 Replies)
Discussion started by: idro
8 Replies

13. 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

14. Shell Programming and Scripting

Mv all files with different extensions to a new name

Hello all! I want to move several files foo.aux foo.log foo.pdf foo.tex to bar_foo.aux bar_foo.pdf bar_foo.tex I am on tcsh % mv foo.* bar_!#:1 is not working. Thank you for your help marek (11 Replies)
Discussion started by: marek
11 Replies

15. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies