UrbanPro
true

Learn DevOps Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Git Branch

Raman Sharma
27/05/2021 0 0

Git Branch

Branching means you diverge from the main line of development and continue to do work without messing with that main line.

Commands

List all the branch

 git branch

Create a branch

 git branch <<branch name>>
 git branch dev

Switch to a branch

 git checkout <<branch name>>
 git checkout dev

Find the current branch (The current branch should have * infront of current branch

 git branch

* dev
  master

Delete a branch

 git checkout master
 git branch -D dev

Git Merge

Git Merge command is used to integrate the changes of different branches into a single branch (mostly used for master branch).For example if we create a branch say dev branch from master branch (now dev branch will have a complete copy of all commited files of master branch) and in dev branch( git checkout dev command to swtich to dev branch) if we add some new files or modify existing files then at last we need to merge these files to master branch because in most of the cases master branch is considered as the branch which has latest project code.

Example

In below diagram there are 3 branches(master,Feature1 and Feature2) , after creation Feature1 branch, it has 2 commits(green color circles) and Feature2 branch also has 2 commits( blue color circles) and these changes are getting merge into master branch at merge commit, now master branch includes the commits of feature1 and feature2 branch ( you can check it with git log command)

command

git merge <branch_name>
git merge dev
0 Dislike
Follow 1

Please Enter a comment

Submit

Other Lessons for You

DevOps Git Lession
*********** GIT ************Git Index:==========1. Introduction to git2. Terminology3. Repo4. gitignore5. logs6. Branching7. Merging8. stash9. unstaging(rm, reset, revert)10. Tags11. bisect12. HEAD13....

Practicing Chef with out installing on your server
Hi Students, Go to the following webiste and create your free account. https://manage.chef.io/login You can practice on your won without having to install Chef for DevOps practice. Create AWS instances...

How to install Apache HTTP in Linux OS
sudo bash // for becoming super user // now left hand side you can see root yum update // for updates yum install httpd // for installing httpd software service httpd start // for starting httpd software Once...

Expectation From An AWS Associate Architect
Designing and Deploying scalable, highly available, and fault tolerant systems on AWS (These are the key points). Migration of an existing on-premises application to AWS (Database). Ingress...

Use Nexus as Docker Registry
There are different tools provides docker registry, and in this tutorial, we want to use Sonatype Nexus Repository Manager as our docker registry, and we will upload our images in there. I am using the...
X

Looking for DevOps Training Classes?

The best tutors for DevOps Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn DevOps Training with the Best Tutors

The best Tutors for DevOps Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more