GIT and GitHub....
Rakesh Kumar
Test engineer|Deployment|HSS| HLR| IMS| 5G| SIP| SDP|HTTP2|PFCP|Diameter protocol|IMS Deployment| Docker &Kubernetes|
- Version control system
- Stages of git/workflow
- Stages of git and its terminology
Introduction: It is the software configuration or source code management tool. there are two types of source code management
- centralized version control system(CVCS):
- In CVCS, a client need to get local copy of source from server, do the changes and commit those changes to central source on server.
- CVCS system are easy to learn and setup .
- Working on branches is difficult in cvcs developer often faces merge conflict
- CVCS system do not provide offline access.
- if cvcs server is down developers cannot work
Drawbacks:
--> It is not locally available, meaning you always need to be connected to a network to perform any action.
--> Since everything is centralized, if central server gets failed, we will loose entire data. for example: SVN tools
2. Distributed version control system(DVCS):
In distributed control version system, every contributor has a local copy or clone of the main repository i.e Everyone maintains a local repository of their own which contains all the files and metadata present in main repository.
- In DVCS, Each client can have a local repository as well as, and have a complete history on it. client need to push the changes to branch. which will then be pushed to server repository.
- DVCS system are difficult for beginners multiple commands need to be remembered.
- working on branches is easier in DVCS developers faces less conflict.
- DVCS system are working fine on offline mode as a client copies the entire repository on their local machine.
- DVCS is faster as mostly user deals with local copy without hitting server every time.
- If DVCS server is down, developer can work using their local copies.
Stages of GIT/Workflow:
- working directory/workspace
- staging area
- Local Repo
Stages of GIT and its terminology:
Repository:
- Repository is a place where you have all your codes or kind of folder on server.
- it is kind of folder related to our product.
- changes are personal to that particular repository
Server:
- It stores all repository (local repository, GitHub)
- It contains metadata also.
领英推è
Working Directory(workspace):
- where you see files physically and do modification.
- At a time, you can work on particular branch.
- In other CVCS, developers generally makes modification and commit their changes directly to the repository but git uses a different strategy, git does not track each and every modification file. whenever you do commit on operation. git looks for file present in the staging area are considered for commit and not all the modified file.
Git Process:
Commit:
- Store changes in repository, you will get one commit id
- it is 40 alpha-numeric characters
- it uses SHA-1 checksum concept
- Even if you changes one dot, commit id will get changes.
- it actually helps to track the changes.
- commit is also named as SHA-1 hash.
Tags:
tag assign a meaningful name with a specific version in the repository. once a tag is created for a particular save even if you create a new commit, it will not be updated.
Snapshot:
- Represents some data of particular time.
- It is always incremental i.e it stores the changes (append data) only not entire copy.
Push:
Push operations copies changes from a local repository instance to a remote or central repo this is used to store the changes permanently into the git repository.
Pull:
Pull operations copies the changes from remote repository to a local machine. The pull operation is used for synchronization between two repo.
Branch:
- Product is same, so one repository but different task.
- Each task has one separate branch.
- Finally merges (codes) all branches.
- Useful when you want to work parallelly.
- Can create one branch on the basis of another branch.
- Changes are personal to particular branch.
- Default branch is Master.
- File created in workspace will be visible in any of the branch workspace until you commit. Once you commit then that file belongs to that particular branch.
to be continued.....