From the course: Learning Git and GitHub
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
Branches
- [Instructor] One of the most powerful features of Git is the ability to create branches. Now, branches let you create different versions of your code, so that you can play around with adding new features without worrying about messing up what's stable. The simplest command you can use is called branch. It lets you take a look at all the branches in your repository. Right now, we only have a single branch. So if we take a look at our project, and we do Git branch, you'll see that we have a single branch called main. Typically, what you want to do is make a copy of an existing branch. You can do that with the Git switch command. It will have the same history as the current branch. There's a slightly older version of this command called Git checkout, and you may see that in a lot of examples. Notice that with Git checkout, you have to do Git checkout -b, and then the name of the new branch that you want to create,…
Contents
-
-
-
Understanding version control1m 53s
-
(Locked)
What is Git?2m 16s
-
(Locked)
Setting up Git4m 35s
-
(Locked)
Understanding Git environments5m 51s
-
(Locked)
Ignoring files4m 5s
-
(Locked)
Deleting and renaming files6m 8s
-
(Locked)
Differences4m 9s
-
(Locked)
Changing history12m 7s
-
(Locked)
Branches6m 13s
-
(Locked)
Merge conflicts10m 7s
-
(Locked)
Git stash and clean9m 27s
-
-
-
-
-