Posts

Showing posts with the label git diff

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...

Comparing file changes with git diff command

Image
Hello Guys, in this post we will explore about git diff command options when to use what option etc. Git basic work flow is going happen initially starts at work area. When you add the files then it will be in the stage area. Once you feel everything is good then we will commit those changes then it will goes to local repository area. In simple words we can say work area -> stage area -> repo area.   The pictorial representation of my understanding about the git workflow: Work flow for git diff command exeuction   How to Compare files in git to get the last changes? In git we have this nice feature to compare a file what has been changed who did the changes we can track them with the inputs we can pass as options to the 'git diff' command. Syntax: git diff [code-file] Examples: You can compare and see all the files which are changed with the last commit. git diff You can compare and see specific file, for example we consider index.html file recently modified and ...