0

Possible Duplicate:
Linux: How to move all files from current directory to upper directory?

I have foo/bar/myfiles and I want foo/myfiles.

I was trying to git clone a repo into foo, but it made the name of the repo as a folder and put the files in there. I'm thinking of just cloning into the same directory as foo and then renaming it, but I'd rather find a solution to this problem.

I'm working on my server, so a solution for linux would be nice, but I do this a lot on my local machine, so if there's something that can be done for Windows as well, I'd appreciate it.

user1125620
  • 215
  • 1
  • 6
  • 14

1 Answers1

0

There are a number of ways to go about this, such as:

mv foo foo2
mv foo2/bar foo
rm -rf foo2

(assuming foo is empty save for the folder bar)

Edited for errors pointed out by slhck

You can also tell it where to clone the repository in the future:

git clone git://repo/bar.git foo
Darth Android
  • 37,872
  • 5
  • 94
  • 112
  • 1
    Only if `myfiles` is a folder. If the OP cloned a Git repo into `bar`, then obviously, this won't work. The question's ambiguous in that respect though, since the title talks about "middle" folder, while `myfiles` would be an indication of … well, some files. In that case, you'd have to make sure to move Git's hidden files as well. – slhck May 16 '12 at 22:59