Day10 of #90daysofdevops | Advance Git & GitHub for DevOps Engineers
Git Branching
Use a branch to isolate development work without affecting other branches in the repository. Each repository has one default branch and can have multiple other branches. You can merge a branch into another branch using a pull request.
Branches allow you to develop features, fix bugs, or safely experiment with new ideas in a contained area of your repository.
Git Revert and Reset
Two commonly used tools that git users will encounter are git reset and git revert. The benefit of both of these commands is that you can use them to remove or edit changes you’ve made in the code in previous commits.
Git Rebase and Merge
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.
The merge wording can be confusing because we have two methods of merging branches and one of those ways is called “merge,” even though both procedures do essentially the same thing.
Tasks :
From the local repository, first made Devops1\Git1\ and within a txt file version01.txt is made and content “This is the first feature of our application” is added.
Now created a branch by using the git branch dev command and added content line by line and committed those.
Now we will go back to our main branch by command git checkout main
And will merge dev branch from here: git merge dev
This will add dev content to the main branch since it is approved now.
Commands used --->
Thanks ...
Subscribe to my newsletter
Read articles from AVINASH SARJERAO POWAR directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by