admin管理员组

文章数量:1435208

I have my own website, within that website I want to showcase my projects. My website files is synced to a remote repository in github named "personal-website". I started to make projects, I want to somehow make a separate github repository for each of them.

as you can see here, my projects are inside the project folder. I want to make a repository for each of them. But I already have a .git file on my website, if I added one to "palindrome-checker" project and push the files on it into a separate repository, would it produce errors? is there any other method?

I would like to make a separate repository for each project, then push there the project files, but still there is a copy of those files in my main website.

I have my own website, within that website I want to showcase my projects. My website files is synced to a remote repository in github named "personal-website". I started to make projects, I want to somehow make a separate github repository for each of them.

as you can see here, my projects are inside the project folder. I want to make a repository for each of them. But I already have a .git file on my website, if I added one to "palindrome-checker" project and push the files on it into a separate repository, would it produce errors? is there any other method?

I would like to make a separate repository for each project, then push there the project files, but still there is a copy of those files in my main website.

Share Improve this question edited Nov 18, 2024 at 10:53 evolutionxbox 4,1326 gold badges38 silver badges57 bronze badges asked Nov 18, 2024 at 10:20 rainrain 115 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

There is a thing called submodule in git which allow you to create sub repos of a main repo. For Example

You have a .git folder in you main Personal Website folder which hold projects folder.

you have to create different repositories for each project inside the projects folder and then add these repos point toward its folders like this

git submodule add /url/of/sub/repo/bmi-calculator ./projects/bmi-calculator

Like this you can connect all the project folders to its repos and these repos are connected to you main repo and when main repo is cloned then you can init these projects again

本文标签: