0
I have a git repository whose structure looks like:
+--- .git
+-- PracticeProject
+- PracticeFramework
+----+log
+----+testdata
+----+test-output
+----+lib

And i want it to like the below code. We are removing the folder - PracticeFramework

+--- .git
+--PracticeProject
+----+log
+----+testdata
+----+test-output
+----+lib
  • Don't understand the one-level up. To remove a folder, git rm -r PracticeFramework – mfnx Jul 09 '19 at 11:42
  • means i want to add all the files which is in the "PracticeFramework" folder to "PracticeProject" folder and remove "PracticeFramework" folder – Saniket A. Soni Jul 09 '19 at 11:56

1 Answers1

0

If you want to preserve history, use git mv and git rm.

git mv PracticeFramework/* PracticeProject
git rm -r PracticeFramework

The first line moves all the files from PracticeFramework to PracticeProject.

The second line removes PracticeProject.

EDIT: according to this, git mv or mv doesn't really matter.

mfnx
  • 2,894
  • 1
  • 12
  • 28
  • encountered this error:- C:\Users\saniket.soni\git\Practice_Project\PracticeFramework>git mv PracticeFramework/* Practice_Project fatal: bad source, source=PracticeFramework/PracticeFramework/*, destination=PracticeFramework/Practice_Project – Saniket A. Soni Jul 09 '19 at 12:56
  • Its "Practice_Project" not "PracticeProject" – Saniket A. Soni Jul 09 '19 at 12:58
  • @SaniketA.Soni according to your question, it's PracticeProject. Also, try to run the commands from C:\Users\saniket.soni\git, not from C:\Users\saniket.soni\git\Practice_Project\PracticeFramework> – mfnx Jul 09 '19 at 13:01