From the course: Git from Scratch
Unlock this course with a free trial
Join today to access over 25,900 courses taught by industry experts.
git branch: Create an alternate timeline - Git Tutorial
From the course: Git from Scratch
git branch: Create an alternate timeline
- [Instructor] The science fiction part of version control with Git is unleashed when you start working with branches. Or, as I like to think of them, alternate timelines. As you develop a project, you'll often find yourself at a place where you want to add a new feature, but doing so may require changing the existing code in a way that will be difficult to undo later. Or, maybe, you just want to experiment and be able to throw away your work if the experiment fails. When this happens, you can use Git to create an alternate timeline, called a branch, to work in. This new branch has its own name and exists in parallel to the main branch and any other branches in your project. Now, as you develop, you can travel between branches and develop different versions of your code in parallel. This way, you can have a stable code base in the main branch, while you develop an experimental feature in a separate branch.…
Contents
-
-
-
-
(Locked)
git branch: Create an alternate timeline1m 8s
-
(Locked)
HEAD: An introduction45s
-
(Locked)
git switch: Go to an alternate timeline40s
-
(Locked)
git checkout: Go to an alternate timeline58s
-
(Locked)
DETACHED HEAD: An explanation1m 15s
-
(Locked)
The difference between switch and checkout1m 40s
-
(Locked)
-