Git Making Branches

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 114:- Git Making Branches

To create a new branch in Git, you can use the git branch command followed by the name of the new branch. For example, to create a new branch called my-feature-branch, you would run:

perlCopy code

git branch my-feature-branch

This will create a new branch based on the current branch you're on. To switch to the new branch, you can use the git checkout command followed by the name of the branch. For example, to switch to the new my-feature-branch, you would run:

perlCopy code

git checkout my-feature-branch

Alternatively, you can combine the creation and checkout of a new branch into one command using the -b flag. For example, to create and switch to a new branch called my-feature-branch, you would run:

cssCopy code

git checkout -b my-feature-branch

Once you're on the new branch, you can make changes to the code and commit them using the git commit command. These changes will only affect the new branch, and won't be visible on other branches until you merge them in.

To merge changes from one branch into another, you can use the git merge command. For example, to merge changes from my-feature-branch into the master branch, you would first switch to the master branch using git checkout master, and then run git merge my-feature-branch.

It's important to manage branches effectively in Git to ensure that changes are properly isolated and reviewed before they're merged into the main codebase.

14. Git

2 Comments

@niteshguptav63
niteshguptav63 Nov 17, 2024 at 1:39 PM

I am not able to access videos from second class and further. I have already completed first class

@niteshguptav63
niteshguptav63 Nov 16, 2024 at 10:56 AM

When will I get my course?

@admin79
admin79 Nov 17, 2024 at 1:29 PM

Now, Your query was resolved.

Frequently Asked Questions About Sciaku Courses & Services

Quick answers to common questions about our courses, quizzes, and learning platform

Didn't find what you're looking for?

help_center Contact Support