# More about Git & GitHub for DevOps Engineers

Git Branching:

In Git, branches are a part of your everyday development process. Git branches are effectively a pointer to a snapshot of your changes.

![GIT Branch Strategies in Test Processes - TesterYou](https://www.testeryou.com/wp-content/uploads/2022/02/gitbr1.png align="left")

## Git Revert and Reset

The `git reset` command is used to undo the changes in your working directory and get back to a specific commit while discarding all the commits made after that one. 

![Diagram of Before and After Git Reset](https://res.cloudinary.com/dyd911kmh/image/upload/v1671196209/Diagram_of_Before_and_After_Git_Reset_9af0fcc3e8.png align="left")

`Git revert` is similar to `git reset`, but the approach is slightly different. Instead of removing all the commits in its way, the revert ONLY undoes a single commit by taking you back to the staged files before the commit.

![Diagram of Revert - Before and After](https://res.cloudinary.com/dyd911kmh/image/upload/v1671196209/Diagram_of_Revert_Before_and_After_4b427cf59b.png align="left")

### What Is Git Rebase?

Git rebase is a command that lets users integrate changes from one branch to another, and the logs are modified once the action is complete. Git rebase was developed to overcome merging’s shortcomings, specifically regarding logs.

### What Is Git Merge?

Git merge is a command that allows developers to merge Git branches while the logs of commits on branches remain intact.

Task:

* version01.txt should reflect at local repo first followed by Remote repo for review. \[Hint use your knowledge of Git push and git pull commands here\]
    

Add new commit in `dev` branch after adding below mentioned content in Devops/Git/version01.txt: While writing the file make sure you write these lines

* 1st line&gt;&gt; This is the bug fix in development branch
    
* Commit this with message “ Added feature2 in development branch”
    
* 2nd line&gt;&gt; This is gadbad code
    
* Commit
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680802379411/d75d6711-8510-480b-94a6-bb68f5896721.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680802529882/1a335f75-b9ea-4241-a68b-7fe764f3a971.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680802586905/b2fd3322-5030-4701-a3a8-dba1c6543f18.png align="center")

This was about additional `git` commands.

Do read and practice it.

Source: @[Shubham Londhe](@TrainWithShubham)

[https://www.datacamp.com/](https://www.datacamp.com/)
