Day 10 Task: Advance Git & GitHub for DevOps Engineers.

#90daysdevops

#day10

What is git rebase?

Rebasing is moving or combining a sequence of commits to a new base commit. It's very important to understand that even though the branch looks the same, it's composed of entirely new commits. It helps to maintain a linear project history.

Task 1

  1. Add a text file called version01.txt inside the Devops/Git/ with “This is the first feature of our application” written inside. This should be in a branch coming from master(Ensure your commit message will reflect as "Added new feature").

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

  • Add a 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>> This is the bug fix in the development branch

    • Commit this with message “ Added feature2 in development branch”

    • 2nd line>> This is gadbad code

    • Commit this with message “ Added feature3 in development branch

    • 3rd line>> This feature will gadbad everything from now.

    • Commit with message “ Added feature4 in development branch

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

    git reset <id>

Task 2:

  • Demonstrate the concept of branches with 2 or more branches with a screenshot.

  • add some changes to dev branch and merge that branch in master

    To merge dev into master/main , first switch to main/master and run command git merge dev

Thank you for reading!!

~Sujata Kumari

Great initiative by the #trainwithshubham community.