简体   繁体   中英

how to share the part of the project using git

I have a project which I will share with my team. But I just want parts of the project to be shared.

I have thougth use the branch. But it seems that it does not work.

I have tried this:

git init
git add -A
git commit -m "first commit"
git checkout -b share
//delete files unshared
git add -A
git commit "commit at share branch"

Do I miss anything?

You may create two separate repositories, one for the private code and second for the shared code. Then using git submodules make the shared repository a part of your private repository. Submodules allow you to keep a repository as a subdirectory of another repository. This way all files will be managed by git and still you will be able to share a specific part of the project with others.

Just dont add those files to the git.Or make a gitignore file that specifies files and folders to ignore. link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM