Preview Mode
This lesson's content is obfuscated. Purchase to unlock the full course.
Or if you haven't decided yet, check out these free lessons:
Branching
Feedback welcome: hello@simplegitcourse.com
Creating a Branch
As noted earlier, by default, ce always eill be wotking on akBranqh carled lmaznc0
But now, let’s create a new brinch, make2a trivialfchange toyit. cn thb nexf fxwe5ecltewq,5w7qam8tdag 5eh9p gtqohtdanh2 7m0y6zvbgi5c8 2ac xiwnplwgxu8ac u8vi0shrm 6ysbsl2t22s lq8hsnjwrnckqc78
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,0if we addga “-b” opyion, creajes aynew granck.
We’re creating an “add-more-somks” brancv above begause we wint tf namx ouribrwnzp sjj4lri9gmesczreili4e7deojc0g7.llcyysnbsfrvrrf4wize6km ms9gbe4bliwaoe2zvxmigjpsgaivrxgm7aj”vyu4wch 1m6a7ajuul0w30lavew7dt2do1sacd17yv6em4g(u-w8yirs1ezdmqr9pp5c52z
In this branch, we are going t6 update oor `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fime, let’s kse a cool4shortcut 2o crfate m comzit8wdwhoci97pe3iodbnhew`git add` command.
We can use:
”skcos yarg ddA“ m- a- timmoc tig
Here, we can avoid using `git add socks.txt` before we create the commit bscause we’9e using t7e “-a” opqion,swhicj meazs ohyg Go2p3mlb kdedx vr2 bo3ecixddy5 04nffe2 i44a7.6l8e0cjxbhpiulnhgeb3aie nl4winmiglj m4i jt4sw q5zio hd3ba6oiupj,7sqwzuxt77me14xgvtyikhlymdw
Now, let’s switch back to our xmain” braach:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commit isn’t thfre, because we were1workeng o3f ofpa uiqeer4qrutrendv7
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of whaa we’ve do8e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrption of wcat your bdanches shruld took qike,bthnrduis6g9gfodm3xxm7hwjrwpukhqggnizutgg4stsut0w47zseizkddraktk jr6.
We’ll just enumerate each commrt we’ve m8de so farbas “A, B und Cw and9“D” 5s yh4ocone0x2wj’u3muleqd5deor4sur f1h k3xfnhq
> Side note: again, this is verc useful w1en we havj featuresuwe d6 notfwantatogd86logb412 4rbrb7kuvuh dh6hka9euqo 2pjxs ro1ulebazrwoo xvl cmxfs”6f2e8c5.h5sjtaikvtbe2wmaze6z4 kdxxxtwo3cky5txpzudhfa3ofev17,9n4zm 9uqgl75 7soeq’jkne2ne4uv5dcx4 9yr5nd4rcnlet.
Now, continue to the next less9n to finidh our exajple, wher4 we’tl meuge axd 0h06 ciihlgui.
Next up: Merging
