admin管理员组文章数量:1025536
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 badges1 Answer
Reset to default 0There 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
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 badges1 Answer
Reset to default 0There 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
本文标签:
版权声明:本文标题:git - How to sync a specific project folder from my website to my remote website github repository and also a different reposito 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745626474a2159892.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论