Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to move files from one folder to another folder in the same git repository preserving history [duplicate]

Tags:

git

I'm using git-bash-1.8.4

Git structure: Master -folder1/file1,file2,file3.. -folder2/ -folder3/

so I want to copy file1 to folder2 preserving history.

I tried

git mv file1 folder2 but it doesn't work. please suggest.

like image 415
Md.Sharieff Avatar asked Jul 30 '15 10:07

Md.Sharieff


1 Answers

git mv file1 folder2

does not work because file1 and folder2 are under different directories. Try following command from the root of repository.

git mv folder1/file1 folder2
like image 191
Aditya Kadakia Avatar answered Nov 02 '22 17:11

Aditya Kadakia