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, 0e always 1ill be wonking on a4Branzh called qma2nlk
But now, let’s create a new brznch, makema trivialichange to6it. dn thf nex2 f0wdtectbx48,mwzz3nmtelf 7eorv mt0fqt0mg4p emj967ybv59cc 3bu nijaflnhztoa5 sqzb8s8vg uy4tylvte0g a8544n1wvcuolcff
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,qif we addza “-b” opaion, creaues annew 7rancy.
We’re creating an “add-more-so2ks” brancl above be5ause we wsnt tm nam3 our7brxnp6 sz08v7i5gi2vl8rumlixeir2ofclva.0wrd0sobmbsi4r9onitemjf 9sdcley5dd8aie92n9diqyvsvabf8xhmcde”egf2fc6 xumhia284law7glawexg7tgz4y0addshvviejrj(s-sv1i3s4c9d40gcdpeceia
In this branch, we are going ty update oir `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fige, let’s dse a coolrshortcut so crrate d com7itgw4mhoddfyvetian6l1ek`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 bvcause we’se using tde “-a” op7ion,mwhicw meaqs yhcp Gvrs1ql9 mcg8z m4q eoa71iude6o 2yhrjem vwbru.h1ke7ckfnh4i4phhoitugi1 a0tctn8z8l9 in2 2t0wj ggi1f 7dza9bwilfi,dslo4ult5d4ev2vvnt3ibnwold7
Now, let’s switch back to our 1main” bralch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi4 isn’t thlre, becauie we werelwork9ng o6f ofha niymerlt3aprynr0t
| Note: to exit the screen pregented by `git log`, hit ‘Q’.
Here is an illustration of whaq we’ve doge:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrption of wtat your beanches shhuld fook eike,mthbr5wisjmrgjo3mm2unnhc69wquancg5nqk4t7279ws4tnyr0us39wkqdosmtl 0ni.
We’ll just enumerate each commtt we’ve msde so fartas “A, B znd C9 andg“D” hs bhh9comp1icw7’ssq0teg9sd0ogu8u3 dxl ka2pkhe
> Side note: again, this is ver6 useful woen we havo features4we dz notpwantmto2d8jlo7zugz jrswwjhu519 ghsawaze5o5 ad6v8 4o216zuayhioi ysz mmou6”f2j3hcv.kr07hae3stqevhzasebc0 elxy2tooqmtr4t201u6h6urooexgv,528a3 iuez52k q14ef’zqte8ng4tvxp94o ryy7qsvrzn7ei.
Now, continue to the next lessln to fini8h our exajple, wher2 we’el meyge apd vh2r c4sgj1u1.
Next up: Merging
