How to useGit-Submodules in GIT
It often happens that while working on one project, you need to use another project from within it. Then why not you can do similar things If you have some large files inside your project. You can manage the files in a separate repo and then use git-submodule to pull them into your project in the same way.
Here is a detailed explanation of the process.
Step 1: Create a new repository for your main project, this will contain your project source codes.
Create a separate repository for the large files, that you want to include in your projects.
git submodule add YOUR_SECOND_REPOSITORY_URL
After adding the submodule, you will see a new folder in your main project repository that corresponds to the submodule. This folder will contain the files from the separate repository.
Commit the changes to your main project repository, including the addition of the submodule.
The above strategies are based on the fact that keeping all those binary files is necessary for your project.
Optimizing Git for Large Binary Files
Version Control Systems are a category of software tools that help in recording changes made to files by keeping track of modifications done in the code.
Table of Content
- What is large binary files?
- The Challenge of Large Binary Files in Git
- Why do we need to optimize binary files in Git?
- Strategy for optimizing Git for Large Binary Files:
- Approach 1: Using Git LFS:
- Approach 2: Using Git-Annex
- Differences Between Git LFS and Git-Annex:
- Approach 3: Git-Submodules
Purpose of Version Control System:
- Multiple people can work simultaneously on a single project. Everyone works on and edits their copy of the files and it is up to them when they wish to share the changes made by them with the rest of the team.
- Version control provides access to the historical versions of a project. This is insurance against computer crashes or data loss. If any mistake is made, you can easily roll back to a previous version. It is also possible to undo specific edits that too without losing the work done in the meantime. It can be easily known when, why, and by whom any part of a file was edited.
Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. When you do actions in Git, nearly all of them only add data to the Git database.
Contact Us