Table of contents
- Git & GitHub is crucial for DevOps so, continuing this DevOps journey let's take a deep dive into it and accelerate your journey to become a great DevOps engineer! 🚀
- 📌 Important Terminology
- 📌 Task 1:
- 📌 Add a text file called version01.txt inside the Devops/Git/ with “This is first feature of our application” written inside. This should be in a branch coming from master, [hint try git checkout -b dev], swithch to dev branch
- 📌 Task 2:
Git & GitHub is crucial for DevOps so, continuing this DevOps journey let's take a deep dive into it and accelerate your journey to become a great DevOps engineer! 🚀
📌 Important Terminology
Branch- repository diverges from the main working directory.
Checkout- checkout is used for the act of switching between different versions of a target entity
Clone: making a copy from the server.
Merge – combining branches
Origin- remote repository from a project was initially cloned
Pull- receive the data from Server (GITHUB)
Push- Upload local repository to sever.
Git Ignore-use for intentionally untrack the fine
Git Diff- shows changes between commit, working tree etc.
Git Rm- for removing files.
📌 Task 1:
📌 Add a text file called version01.txt inside the Devops/Git/ with “This is first feature of our application” written inside. This should be in a branch coming from master
, [hint try git checkout -b dev
], swithch to dev
branch
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>> This is the bug fix in 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
📌 Task 2:
Demonstrate the concept of branches with 2 or more branches with screenshot.
- add some changes to
dev
branch and merge that branch inmaster
git merge main dev
git status
git push -u origin main
- as a practice try git rebase too, see what difference you get.
git rebase master: The command “git rebase master” can be used to make all modifications found in your master branch part of your current branch.
git rebase –continue: When we are rebasing the branches we will face some conflicts and issues then we need to resolve the issue. After resolving the issue we again continue the rebasing processes for that we use “git rebase –continue”.
git rebase –abort: “Git rebase –abort” command cancels a rebase that is currently underway and restores the branch to its initial state.
git rebase –skip: When rebasing the branches we might face some unresolved conflicts to skip the particular encounters we will use “git rebase –skip”. Skipping the commit is not good practice it will damage your codebase.
git rebase -I HEAD~3: With the help of this command, you can interactively rebase the most recent three commits onto the active branch. You can choose which commits to rebase, alter commit messages, and squash or divide commits in the interactive editor that is opened.
If you find my blog valuable, I invite you to like, share, and join the discussion. Your feedback is immensely cherished as it fuels continuous improvement. Let's embark on this transformative DevOps adventure together! 🚀 #devops #90daysofdevops