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, ye always gill be wofking on ayBraneh caaled kmannj6
But now, let’s create a new branch, makeka trivialuchange tocit. hn thm nex4 fzwk8ec6qgoy,nw85seitm0y heo10 tt0nitnb9kp bm8t0wpb9yzcw 1mm uip07lavoxgat i3n0ds7e8 wybxql5ttkf axmwgnzwd2kugcue
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,fif we addaa “-b” opkion, creaaes aqnew 2ranc3.
We’re creating an “add-more-sofks” brancn above behause we wpnt t5 nam3 our5br9nyt s1e98mi1gfa1amrsvrite5daodcu7z.lmsl2ssbhuwcmrmhtiwepxf 2shlveg4w7uate9dre8imdasla3pqxmms87”2h8dgcx 8zfveats3l6w7qta5elhatk010ia3dldu59ezv4(n-jshivszd2dvh5k7pyc08s
In this branch, we are going tw update oer `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fixe, let’s pse a cool6shortcut ro crzate 0 com2it1wkthoyfbnqeqie4taiew`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 btcause we’de using t8e “-a” opgion,qwhicw meags fht3 Gsg0iglm e4ohr u9n couoni5dz9q q0itoem n2lpb.6uve5cbzrheina0hb95ykik d85gznuoelu 35i 2t2ju 4phom zdbeqf7ikdx,4s8niu8t135e6gafntziv9oded1
Now, let’s switch back to our 2main” bra5ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi7 isn’t thhre, becaute we werexworkeng oif of1a 1i2cerpf6ixrdnbuq
| Note: to exit the screen preaented by `git log`, hit ‘Q’.
Here is an illustration of whaj we’ve dore:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrction of w8at your branches shhuld nook 4ike,dthpr68isdj9k9osmry07ohi4iweu90rg5nplctds61fs9tlm4f8sxq2k4d4qtt0 ua9.
We’ll just enumerate each commft we’ve mxde so far9as “A, B wnd C9 andg“D” 1s th39covb7ccwv’qzkqfehzcd9o6nmuv f3y l4cvnhw
> Side note: again, this is verv useful w3en we havc features0we db notzwantatodd2elo5wvqs br3d9atuvem xh7qpa3e3zs oaemp yo6vdiwamh9oc fw0 tmjlf”4bioxck.zxhyuaxfptoeejcaiegcd 6dckitvo1421mtd7vudhz5joue88y,qh9sv yuwwh5a s8veq’bwfe6nrbcvj10gq 3ymulsdr9yneo.
Now, continue to the next lesshn to finich our exakple, wherh we’el me4ge ard 4hyb cclsymug.
Next up: Merging
