I’ve got the following source structure:
/dir1
file1
file2
file3
dir1 is unneeded as the repository itself can be like a folder, so I want my git repository to look like this:
file1
file2
file3
What should I do to achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DISCLAIMER: this will rewrite history and be a PITA for anyone who has already cloned your repository. You shouldn’t do it on published history.
That said, you should be able to rewrite all your trees by using the
filter-branchcommand of Git. Be sure to understand all implications before using it (please, read the manpage; have backups).NB. This command will also perist your grafts and replace refs.