What is Git LifeCycle?

2 minute read
0

               Git lifecycle description

 Theory: Git is one of the premier distribution version control systems that are available for developers. As such, it’s necessary to understand the life cycle of git. The life cycle of a git can be described through its workflow and the areas where the project goes through.

PROCEDURE: Workflow of the git life cycle:-

·      Clone: First, when we have code present in the remote repository, we clone to local to form something called a local repository.




·      Modifications/Adding files: We perform several developments on existing files or may as well add new files.





·      We need to move the content that we require to transform to the master to the staging area by using git commands and the snapshot of staged files will be saved in the git staging area.

·      We need to perform commits on the files that are staged and the recorded snapshot from the above steps will be permanently saved on the local repo and this particular is recorded by commit message for future referrals.








·      Once we commit the code is available on the local repo but to send it to the master repo, we need to perform a PUSH operation.

·      If someone else is working on the same branch then there will be a possibility that he might have added his changes to the master by push. So we need to perform a PULL operation before the PUSH operation if multiple people are working on the same branch.



·      Once the basic branch is updated, we need to get all the required approvals so that the merge operation with the master is allowed.


      Stages of the git life cycle:- 

                              


            

·      Working Directory: Starting at the bottom is the working directory where the created, edited, deleted, and so on. Any new content must exist here before it can be put tracked by git.

·      Staging area: This serves as a holding area to accumulate and stage changes from the working directory before they can be committed into the next level-the local repository.

Repository: After the staging area comes the local repository. This is the actual source repository where the content that it manages is stored. Once the content is stored in the repository it becomes a version in the repository and can be retrieved later.
To Top