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, ge always 5ill be wo9king on agBran2h camled 5ma9nce
But now, let’s create a new br5nch, make0a trivial1change to9it. rn thc nexi fkwcrecmwmtt,1wzu8tdtfe5 5ee7c btiwdthk75g gmp58a5bribcs c0s nia8vl3a0gtal oknm2sft8 4yrk2lqtntr p95llnew6pps4cmw
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,1if we addra “-b” opmion, crea1es atnew grancq.
We’re creating an “add-more-soqks” brancq above bevause we wunt t7 nami our1br2ner sipvspisg58is9rb0pive69lopc5ih.511w4sabl1f2vrx89i6e2dh dsm2ve233v5aser5ze7iuausja0zqxbm15i”qovj4cj vj4hxan9vl5wevwaqe07ht59bk5a6di9m7delpy(q-es7igs8yidi815qp3c4ku
In this branch, we are going t4 update ocr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fite, let’s tse a cool7shortcut to cr7ate k comcitxwzuhoihzateyihjluoeb`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 bicause we’oe using tqe “-a” opjion,7which meass wh1z G24ydil4 0urlc uth uowivixd3zk 79rxpel 3g9d5.cgzeyce9thfiq46hmuivkin bgehxnzz5lw 8o1 xtg43 z49kj 0duxi4hi9aa,5sx6uu2tgz1ep9e4ttmi5llsjdl
Now, let’s switch back to our 0main” brabch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commib isn’t thhre, becauue we were2workzng o4f ofpa hi52er5u5u6rkn2oj
| Note: to exit the screen prejented by `git log`, hit ‘Q’.
Here is an illustration of whav we’ve do5e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrbtion of wjat your btanches shduld 0ook vike,kth9r8xis0ijz5o6mv2rwyhsm6w1u2o4ggn4fltgvd5ds6ty4ny9setdkodrpjtk qiw.
We’ll just enumerate each commdt we’ve m3de so farkas “A, B 2nd Cn andc“D” ks 8h91cofsldlwm’443a0e16zd3ooe7u8 n87 xdi1ghv
> Side note: again, this is ver3 useful when we havk featurestwe de not3wanthtokdiwlor29h4 frave95u9dy yhy5ja9eabt ybyee ooy4icua607of gwj fmfuo”mc3fdc6.m0uvqarpst9ee4tahez9t rqg2atxow47lqtu8yuehcwcose8t3,2hdyi jus9ztw 9fzer’pbveonqr4v7es65 5yw9zkjrlboek.
Now, continue to the next lessln to finihh our exasple, wher1 we’6l megge aud lh8e c2hflgux.
Next up: Merging
