Day 10 Task: Advance Git & GitHub for DevOps Engineers.🚀
🚀Day 10 Task: Advanced Git & GitHub for DevOps Engineer🚀
Hey there, DevOps enthusiasts! Today, we're diving into some advanced Git and GitHub techniques. 🛠️
Branches are like separate playgrounds for your code, allowing you to work on new features, bug fixes, or experiments without disturbing the main branch. 🤹♂️
- The default branch is the main one, but you can create multiple other branches.
- Merging branches using pull requests keeps things organized.
Git provides handy tools for undoing changes:
- Git Revert: It helps you create a new commit that undoes a previous one. Perfect for keeping a clean history.
- Git Reset: This command lets you go back in time by modifying the branch pointer. It's a bit more forceful, so use it carefully.
Git Rebase allows you to integrate changes from one branch into another. It also cleans up your commit history. This is particularly useful when merging isn't ideal.
Git Merge is another way to combine branches. The key difference is that it keeps the original commit history intact. You'll often use this for simple branch merging.
It can be confusing, but both Git Rebase and Git Merge serve their own purposes. Understanding when to use each is essential. 🤔
Recommended by LinkedIn
If you want to remove the last three commits and go back to the state before the changes, you can use git reset:
This will uncommit the last three commits. You can then force push the changes to the remote repository to update it
Now, the 'version01.txt' file should contain the original content: "This is the first feature of our application."
3. Merge 'feature-branch-2' into 'master':
4. To practice using rebase:
This will move the commits from 'master' on top of the 'feature-branch-2' branch, creating a linear history. Use git log to see the difference in commit history between merge and rebase.
keep branching, merging, and rebasing! 🌳 #DevOps #Git #GitHub #CodingIsFun #DevOpsWithAWS #90DaysDevOpsChallenge #trainwithshubham #tws Shubham Londhe #AWScloud #amazonwebservices