Advanced Git and GitHub for DevOps

Advanced Git and GitHub for DevOps

What is Branching?

Git branching is a feature of the Git version control system that allows developers to create separate branches for development within the project. Each branch represents a different path of development, and it enables multiple people to work on different features or bug fixes simultaneously without interfering with each other's work.

Main Branch: It is usually the master or main branch. This is the default branch and the stable branch of the project.

Feature Branch: This branch works on new features or enhancements. Once the feature is complete the changes are merged back into the main branch.

Bug Fix Branch: When any bug is discovered you can create a bug fix branch to debug the issue.

Release Branch: This branch is created for new software releases.

Git Revert and Reset

`git revert` is the command we use when we want to take a previous commit and add it as a new commit, keeping the log. It's a safe way to revert changes while preserving the commit history.

git revert <commit-hash>        

Git Reset:

`git reset` is the command we use when we want to move the repository back to a previous commit, discarding any changes made after that commit.

There are 3 types of git reset

  • --soft: Moves the branch pointer, preserving changes in the staging area.

git reset --soft <commit-hash>        

  • --mixed (default): Moves the branch pointer, un-stages changes, but preserves them in the working directory.

git reset --mixed <commit-hash>        

  • --hard: Moves the branch pointer and discards changes in both the staging area and the working directory.

git reset --hard <commit-hash>        

Git Rebase and Git Merge

`git rebase` is the process of moving or combining a sequence of commits to a new base commit.

`git merge` is used to combine the changes from two or more branches into a single branch.


要查看或添加评论,请登录

Daniel Gurus的更多文章

  • Why prefer Kubernetes ?

    Why prefer Kubernetes ?

    Kubernetes has become a cornerstone in modern container orchestration and management for a variety of reasons. Its…

    3 条评论
  • AWS EC2 Automation

    AWS EC2 Automation

    Instance Types General Purpose Instances (e.g.

  • AWS and IAM Basics

    AWS and IAM Basics

    AWS Identity and Access Management (IAM) is a web service provided by Amazon Web Services (AWS) that enables you to…

    2 条评论
  • Managing Persistent Volumes in Your Deployment

    Managing Persistent Volumes in Your Deployment

    What are Persistent Volumes in k8s In Kubernetes (k8s), a Persistent Volume (PV) is a cluster-wide piece of storage in…

  • Mastering ConfigMaps and Secrets in Kubernetes

    Mastering ConfigMaps and Secrets in Kubernetes

    What are ConfigMaps and Secrets in k8s ConfigMaps: ConfigMaps are Kubernetes resources that allow you to decouple…

  • Mastering Docker Best Practices: A DevOps Engineer's Guide

    Mastering Docker Best Practices: A DevOps Engineer's Guide

    Introduction: In the ever-evolving landscape of software development and deployment, Docker has emerged as a…

  • Devops Best Practices for Seamless Integration

    Devops Best Practices for Seamless Integration

    Introduction: In today's fast-paced tech world, the need for efficient collaboration between development and operations…

    1 条评论
  • Working with Services in Kubernetes

    Working with Services in Kubernetes

    What are Services in K8s In Kubernetes (K8s), a service is an abstraction that defines a logical set of pods and a…

  • Working with Namespaces and Services in Kubernetes

    Working with Namespaces and Services in Kubernetes

    What are Namespaces and Services in k8s A Namespace in Kubernetes is a way to partition cluster resources. It allows…

  • Basic networking concepts for Devops engineer

    Basic networking concepts for Devops engineer

    Here are some fundamental networking concepts that are important for a DevOps engineer: IP Addressing: IPv4 and IPv6:…

    3 条评论

社区洞察

其他会员也浏览了