With the above command, we are adding a submodule named osm_java whose URL is and branch is armstrong. Remote: Total 23 (delta 3), reused 0 (delta 0) Remote: Compressing objects: 100% (17/17), done. $ git submodule add -b armstrong osm_javaĬloning into './provisioner/roles/java/osm_java'. So we’ll add submodules osm_java and others. We can see in this Armstrong’s provisioner repository(a git repository) depends upon five roles which are available in OSM’s repository to help Armstrong to provision their infrastructure. Here comes the git-submodule as a modular rocket to take our Super Rocket to its destination. And to do that there is a lot of copy paste, deleting the repository and cloning them again to get the updated version, which is itself a hair-pulling task and obviously not the best practice. Which creates a problem statement to manage all dependencies which might get updated over the period. This makes the client projects dependent on our OSM. So that those roles can be used in the provisioning of the client’s infrastructure. ![]() In which we create Ansible Roles of different opensource software with the contribution of each member of our organization. Hence, Opstree Solutions initiated an Internal project named OSM. We decided to Automate it, which a DevOps is habitual of. Hour of Needīeing a DevOps Specialist we need to do provisioning of the Infrastructure of our clients which is sometimes common for most of the clients. And if we talk about managing projects Git can’t be ignored, Moreover Git has a concept of Submodules which is slightly inspired by the amazing rocket science of modules. Similarly is the case in the Software world, where super projects have multiple dependencies on other objects. The literal definition of modules states “ A modular rocket is a type of multistage rocket which features components that can be interchanged for specific mission requirements.” In simple terms, you can say that the Super Rocket depends upon those Submodules to get the things done. Rocket Science has always fascinated me, but one thing which totally blows my mind is the concept of modules aka. This commit object we can explore further with the help of cat-file which will show the type and content of tree and commit object: git and take the SHA value for the master head: I have added content(hello) to readme.md and made many changes into the same repository as: Inside the folder where we have cloned the repository, go to the folder kunal then: Suppose we have cloned a repository named kunal: Made some changes and tracked those changes(type, content, size etc).īelow example will help you understand the concept behind it. I just created a local remote repository with the help of git bare repository. That pushed me to explore Git more deeply. I was doing it once and made multiple changes, I was thinking it would be great if I could see the details of changes through local repository itself instead to go to a remote repository server. Often we make changes to our code and push it to SCM. The “commit” object links a physical state of a tree with a description of how we got there and why.Ī commit is defined by tree, parent, author, committer, commentĪll three objects ( blob,Tree,Commit) are explained in details with the help of a pictorial diagram. We can use git ls-tree to list the content of the given tree object git/objects/ folderīlob stores the content of a file and we can check its content by commandĪ tree is a simple object that has a bunch of pointers to blobs and other trees – it generally represents the contents of a directory or sub-directory. After pushing some files, it would reflect in the. After initialising a git repository, it automatically creates. Then there are branches and tags, which are typically just references to commits. By default, every new version of a file gets a new blob, which is a snapshot of the file (not a delta like many other versioning systems).Ī tree is a list of references to blobs and trees.Ī commit is a reference to a tree, a reference to parent commit(s) and some decoration (message, author). ![]() ![]() Objects are immutable (they are added but not changed) and every object is identified by its unique SHA-1 hashĪ blob is just the contents of a file. The Git object model has three types: blobs (for files), trees (for folder) and commits. We would be learning #gitinsideout through this blog It simply means that you can insert any kind of data into git for which Git will hand you back a unique key you can use later to retrieve that content. ![]() Git is basically a file-system where you can retrieve your content through addresses.
0 Comments
Leave a Reply. |