DevOps And Git
It starts with the developer making the code for the company requirements like developing a website.To manage the code he uploads it in a system know as VCS(version control system).The VCS is basically GitHub to manage the codes.The employees of the company download the code from there and then they build ,run and test it.
BUILD:
The developer of the code does not upload the libraries so the company people download the appropriate version of libraries for the code to run this is called building the code.
RUN:
The code is now ready for testing so it is executed and tested ,if it is according to the company requirements or not,for instance if the look and feel of website is up to the mark or not etc.The developers design the code according to a document called SRS(software requirement document).
RELEASE:
we host the website on the web server and make it available for the user to use.
Now the next step is to deploy the website on a web server and the customer or user uses it.We continuously monitor it for any valuable feedback given by our users .According to the feedback we update the SRS document an tell the developers to make changes accordingly.This process continues like an infinite loop.
Earlier the companies used to develop the website according to all the requirements given in SRS but it may take a lot of time to make the code for all of it at once and as result the company will fall behind the others in this competitive world so the company makes a major part of the code and deploys it and release the other parts one by one in small intervals as soon as they are completed by the developer.One drawback of making whole code at the same time is that ,suppose the developer takes 10 days to complete a code the others teams like testing and building teams sit idle for that time.
This methodology is called DevOps.It forms an infinite loop.
GIT:
It is used to mange the code the developer makes.This is a software used by GitHub to manage git repository.We keep the code in git repository(basically a folder to keep code).we make the folder as git repository so that we can use functions of git on the code.we use “git init” command to make a folder as a git repository.A git repository is created per folder basis.
VCS:
The developer makes the code and uploads it to a git system(GitHub) .The developer makes changes to the code everyday so in git it is termed as making different versions.During the course of development of code one may make some error and it would be tough to point out as there are thousands of lines of code , so git gives us the facility of ROLLBACK .We can get back to the previous version of code ,which is called ROLLBACK.Thus , we have a system which maintains different versions of code and thereby know as VCS(Version control system).
SCM:
If the data inside the file in git repository is source code then we use a special name(Source control management).
HEAD:
The current version of code or the version last updated in git is called head.
DELTA:
The Developer makes a version of his code,after some time when he has made changes to his code the next version which he makes contains the changed part(the delta part) and not the whole code i.e. only the changed part is copied in the next version of the code.This is why copying is very fast in git. A lot of space is saved .It is called snapshot.It is different from backup as in backup the whole code is copied.
We do not want to make versions of all the files(codes) in the git repository so we add the codes whose version’s we want to make to staging area.
We add the code to the staging area for tracking.Git monitors the code that is kept in staging area, through “git add” command and when we want to make versions, through “git commit” command.As the git command works in git repository so the working folder is called git repository after using “git init” command.
BRANCHING:
When many Developers are working on the same code so it becomes difficult to manage it so we create different branches which would contain the same code but changes made to the code by developers would not be reflected in the branches as they are independent,multiple people can work on the same code in parallel.The original branch is called the master branch.The other branches can be given a name.