22

Git From Beginner to Advanced Step by Step With Graphical Animation

 4 years ago
source link: https://mohamedradwan.com/2019/05/31/mastering-git-from-beginner-to-advanced-step-by-step-with-graphical-animation-commands/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Git for Beginner and Advanced Step by Step With Graphical Animation

Git for Beginner and Advanced with Step by Step using Graphical Animation Commands.

This git tutorial video will help you learn Git with animation, It will help you deeply understand Git commands from the ground up. It will explain commands in graphical representation with animation which will make it very easy to understand different Git commands. You will understand and see how the Git tree is structured and how it’s working, how to branch and merge, what is the difference between merge (non fast-forward) and rebase (fast-forward merge).

You will also learn how to use cherry-pick, how to squash before the merge, moving HEAD and many others.

Content will be covered in this video:

  • Animated git branch
  • Animated git merge
  • Animate git cherry-pick
  • Animated git rebase

Tip ( Kubernetes cluster for beginner ) For more information about how to work with Kubernetes cluster and deploy it to Azure Kubernetes Service (AKS) and work with Azure Container Registry, see Kubernetes cluster for beginner

Some points that will be covered in the video:

It will be a walk through git commands as step-by-step with graphical animation for git tutorial. This will be for beginners and advanced too.

I will talk about some of the git basics commands and explain how each command works. This will be through animation.
I’m not going to talk about git configuration or git architecture or git component but instead, I will focus only on git commands but with animation.

At the end this video should help you to understand what is Git? How to work with Git? What are the basic commands of Git? and many other questions.

So, the first part of this git training, we will see a demo of git commands in a graphic with animation, for example, we will see how to create a branch, git rebase the fast-forward (FF), git merge or non-fast-forward (non FF).

We will also see how to cherry-pick some of the changes instead of merging all the changes in the branch and many others then we will go for a demo with a command-line where we can apply what we have learned in the animation and we will map this command-line to the animation. So, you can understand more about these commands and can represent them in your mind.

So, what is git commit?
Commit is the delta that has only the new changes, this is why each commit points to parent commit or which commit are based on because git is optimized for resources utilization then it only has the delta with each commit and in order to get for example a snapshot with all the changes it means that I need to get all the changes starting from this commit back to all the comments.

Tip ( DevOps for beginner ) For more information about DevOps, what is DevOps, how to work with DevOps, what is Continuous Integration and what is Continuous Delivery. What is the difference between CI pipelines and CD pipelines and many other topics? See DevOps for beginner

What is the git branch?
Git branch isolates new commits starring from this point, which will keep pointing to parent commit before the isolation. Once you create a branch it means that you would like to have more commits in isolation way.

So, what is git merge non-fast-forward?
Git merge is a new special commit that has two parents commits. Think of that as it creates a new commit and this commit pointing to two parents, one is the original parent which is the last commit from the parent branch and the last commit from the current branch.

What is git rebase fast-forward?
Git rebase reapplying the new commits. So, instead of having two parents commit, it will copy and recreate the new commit on the target branch from the commit that starts the isolation, so the last commit or the merge commit will only have one parent.

Git HEAD
The git HEAD is pointing to where your new commit will go.
Let’s say, I made some changes and usually the changes are either adding new files, editing an existing file or deleting existing file, we will call them changes. so after making some changes, I start to commit them. So, I will type git commit and we will see that I will have a new comment which has only the delta of my changes and we will see that the master branch pointing to the commit as well as the HEAD.

Git branch

Now let’s say that I want to have a new branch to isolate new commits in it.

So, I will start by creating a new branch by git branch new branch-name
Once I have created the branch and the HEAD will point to the same commit which is still pointed by the master branch
If I commit now, let’s say I make some changes and then do a git commit, this will not commit to my new branch, instead, it will commit in the master branch because I didn’t move the HEAD to the new branch.

Yes, I create the branch but the HEAD was still pointing to the master branch. Not to the new branch
So, to have my changes and new commit to a branch, I need to move the HEAD first to that branch by Git checkout branch-name

Git reset –hard Commit-id
I can move the HEAD by using git reset with the commit-id, we can also move the HEAD or detaching it using refs.
Git cherry-picks
We can use cherry picks to pick only some changes without other changes or commits.

Start working with Git (git init)
Open your directory where you want to start working and type Git init which will make git initialize, this will create git files. To see these files, we just need to open the hidden so we can see them, these git files are responsible for tracking the changes and history.

Then I start make changes, commit the changes. Also, I can add git remote to push my changes to a remote repo on the cloud.

The video will explain all that command and more with animation

DevOps is very important for software development and delivery. You can find more information about DevOps in the following post:

Building and Deploying your Code with Azure Pipelines


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK