# Advance Git & GitHub for DevOps Engineers.

## 📌 Git Branching

Git branching is a way to work on different versions of a project simultaneously. Git branches are effectively a pointer to a snapshot of your changes.

## 📌 Git Revert and Reset

Git revert Allows you to create a new commit that undoes the changes introduced by a previous commit without removing it from the project's history.

Git Reset is more like moving the branch pointer to a different commit. It allows you to reset the project's history to a specific commit, discarding commits after that point

## 📌 What Is Git Rebase?

Git Rebase is a powerful Git command used to integrate changes from one branch into another. It allows you to modify the commit history by moving, combining, or excluding commits

## 📌 What Is Git Merge?

Git Merge is a Git command used to combine changes from one branch into another. It allows you to integrate the work done in a feature branch or any other branch back into the main branch.

## 📌 Task -1 Demonstrate the concept of Git Branch and Revert

```basic
Add a text file called version01.txt inside the Devops/Git/ 
with “This is first feature of our application” written inside and commit the changes
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690637439321/fce4110f-cc53-473d-be83-5d82cb1a98f3.png align="center")

```basic
version01.txt should reflect at local repo first 
followed by Remote repo for review.
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690637558176/8cb30513-5ac9-4440-8a55-256ff282d9a1.png align="center")

```basic
1st line>> This is the bug fix in development branch
Commit this with message “ Added feature2 in development branch”
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690637719281/fda04e91-8c0b-404b-88f0-ffc74044322e.png align="center")

```basic
2nd line>> This is gadbad code
Commit this with message “ Added feature3 in development branch
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690637834826/64d80890-b6e1-480c-bb2a-124d0fbf48cf.png align="center")

```basic
3rd line>> This feature will gadbad everything from now.
Commit with message “ Added feature4 in development branch
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690637916791/ccc6f914-0b5c-412b-b5ca-36eefc1864b9.png align="center")

```basic
Restore the file to a previous version where the content
should be “This is the bug fix in development branch”
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690638104756/25eff37a-eb90-4b7c-bed9-632c9a945c8a.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690638134348/2cc25c70-0f2a-41b1-8953-a2bc6d7cf46d.png align="center")

## 📌 Task -2 Demonstrate the concept of branches with 2 or more branches

```basic
merged two branches
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690638274000/cd0700b5-b76a-4f68-8638-5d1d0fc163dd.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690638312062/55706fba-1588-48cf-873c-110a90d9b591.png align="center")
