Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
2  
To clarify, are myfiles some files, or is that a folder? –  slhck May 16 '12 at 23:01
add comment

marked as duplicate by slhck, Hello71, Kyle, KronoS, Dennis Jul 21 '12 at 14:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

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
share|improve this answer
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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.