Introduction
When using GitHub, we often use other people's projects. However, directly cloning (copying) them into our own projects takes up too much space. After all, GitHub provides limited space for each user. Therefore, we use referencing instead of copying to use other people's projects.
We often see GitHub repositories referencing other repositories, just like creating a symbolic link:
When we click on it, it opens another GitHub repository (which can be someone else's repo).
- Operation Process
We have already cloned a project called "yolo2via" to our local machine using GitHub Desktop.
In GitHub Desktop, click on Repository -> Open in Command Prompt.
Then, we will see a terminal, as shown in the following image:
For example, if we want to reference the "yolov7" project, we enter the following command in the terminal:
git submodule add https://github.com/WongKinYiu/yolov7.git yolov7
Then, open GitHub Desktop, enter the update description, click "Commit to Main", and finally click "Fetch origin".
After that, go to the GitHub website and you will see that "yolov7" has been added.
Original article link: https://blog.csdn.net/WhiffeYF/article/details/126686686