Posts

Showing posts with the label git add

GIT Commands reference for DevOps Engineer

Image
Dear DevOps Engineer!! this post is full of experimenting with git commands running most of them on the 'Git Bash' window in my laptop. I've collected three things about each git command. git command syntax What this git command will do - short descriptions An example command that I've executed Screenshot of that command execution How do I Start a Fresh repository in Git CLI(local repo)? You need to create a folder where you would like to start your coding project. The code can be web-site related where you can have multiple directories involved such as HTML files into a folder, all images to be used in the website in a folder, CSS files into a folder, etc. First, make the folder structure for you project then at the root of the project need to initialize the project.  To create empty repo or re-initializing a repo Syntax : git init Note: It is always better to have a fresh directory created and then run the above command to initialize a...

Git File Lifecycle

Image
In this post, we will explore, experiment and see git basic files and folder -related commands if you are familiar with the Linux file system this will be easy for you! But, again no need to worry about that we will see every command execution with experiments. Every software product/server Lifecycle can be visible with their STATUS output, where they are currently if you know then you can move to different Lifecycle state. Let's understand how this navigation happens on the Git repository. Git File lifecycle status changes with commands Git Status Git Status will always compare the files and folders with the indexed with untracked files and display their status.  Syntax: git status [options] This command will check the status of the current branch by comparing it with the master branch Example: git status -s This `git status` command will show the working tree status. and it is having multiple useful options. When you use the -s or --short option it will display the...

Git branching - local and remote

Image
Hello all, in this post specially dedicated to all DevOps/DevSecOps Engineers.  Where their daily routine will have this commands if we know these we can play with them easily if you don't then it will be horrifies you!  Git Branching explained in detailed Prerequisites to this you should be aware git basics and to experiment with these command examples should have git installed on your Mac/Linux or git bash on Windows system. What is the Branch in Git? A Git branch is a separate line of work, where your work will not disturb other DevOps team members work. Branch is a simply a movable  pointer to commit, this we can observe using git branch command output wherever you see that '*' prefixed there the pointer pointing. Default branch is master or main (new trend) but it is optional we can name anything when we initiate the git repository. Main branch is the FIRST branch of your project that means once you run the 'git init' then 'git branch' you can observe t...

Git log - commit history

Image
Here is the GitOps story! we started learning more depth of every GIT commit history using git CLI. In this post, we have touched some rea-time scenario-based question and answers with practical examples which are useful for other DevOps team members.  The best question to help release management - who worked on the critical program/script which is in the release process? This can be found using the git log command.  The most interesting story if someone left the company and need to know what he did in his last commit. Tracking changes all of them done by that particular user.  The git log having many options: sorting filtering output formatting Let's see in detail by with experimenting each with an example. How to get the git log in a "Sorting order"? Here we have a couple of sorted commit history commands.  Using the --pretty value with  Oneline to going to give you the log output in simplify format. git log --pretty=oneline The output combination of ...