Posts

Showing posts with the label git merge

Git Merge Rebase and Cherry Pick - deep dive

Image
Hello guys 🙂 this post I would like to share with you about the " git merge " experiments. We have multiple code lines in the project, once the developer completes his task branch is ready to move to the next branch for testing.  Git Merge and git rebase There are multiple ways to combine the code lines. If the HEAD pointed to the tip of the branch then the best way to merge from the other branches into the current branch.  FF fast forward merge  3 Way merge You will be on the target-branch (most of the time it will be main/master or release or production) and then you will run the following command with a source-branch. git merge [branch-name] The following example for the Git Merge 'ort' Strategy, let's begin clear mkdir merge_test; cd merge_test; git init # on main branch two commits touch test1 ; git add . ; git commit -m "test1" touch test2 ; git add . ; git commit -m "test2" # branch out feature and do 2 commits git chec...

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