After the transition from SVN to Git, there were problems with setting up the deployment server.

All in order. We have the following folder structure in the master master:

trunk_old/ .... trunk/ Тут все файлы сайта и статика 

I need to pull only the trunk directories with all the files and subdirectories inside. This is great to do with the command:

 git fetch origin master trunk git checkout trunk 

But now the trunk folder is created, actually in the www folder (where the git repository is created) well, and it turns out that the site is not available at site.ru/ , but at site.ru/trunk/ . But we need to download all files from the directory we need to the repository root.

How to fix it with the correct combination of git commands? Any ideas?

  • one
  • 2
    so trunk in svn is just the current git development branch, why do you even need to repeat this structure in git? (well, in the end, you have the same site, it means it has a docroot, point it to the site.ru/trunk directory if you really need it) - zb '

1 answer 1

It can be like this

  git filter-branch --subdirectory-filter trunk/ -- --all