简体   繁体   中英

Git Sync subfolder git

In Gitlab, I have a folder structure like this (example):

MyCodingProject

  • Code
  • UsefulMethods

Whenever I update any of those folder, it syncs with Gitlab and versions it. I want to be able to share my "UsefulMethods" folder with other people (and only this folder) and for them to modify its content. Whenever they make some change or update, I want to be able to "pull" it. Also I want that whenever I update it in "MyCodingProject", it also updates it everywhere else or at least have the ability to allow people to "pull" it

I thought of doing a git init inside the UsefulMethods folder but that would still mean that it's not update if I only to a git commit/push of the MyCodingProject folder.

I ended up making a script in my UsefulMethods folder, that checks whether any changes has been made. If changes has been made, it does a git pull, git add, git commit then a git push. Every hour, it does a git pull to see if someone has made any changes

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