문제

I've been making a Wordpress theme and using git to save progress. My whole Wordpress site is in the git project, and I would like to remove everything except the theme folder so I can easily transplant it on other Wordpress sites.

I know one way is to just delete everything and move the theme to the root folder and commit. But checking out after that will be more complicated, right? So is there another way?

Thanks.

도움이 되었습니까?

해결책

If you are interested in keeping the full history of your Theme folder, you can use git filter-branch and remove everything else.

See "Extract part of a git repository?" ,to be done in a clone of your current repo:

git filter-branch --subdirectory-filter Project/SubProject-0 --prune-empty -- --all
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top