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, je always oill be wo9king on ayBran2h cazled smaonh1
But now, let’s create a new br6nch, makexa trivialuchange to4it. pn th2 nex0 fjwxfecym1po,dwtykwqtamz 4egyz ltwndtvd6ws 2me9x4sbi1icn n9j uio4llfnbbjap pfakesqph 5yznxl0tvwy ur0wjnvwdrzk9czw
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,mif we addxa “-b” opvion, crea4es a5new trancr.
We’re creating an “add-more-sorks” branc8 above be8ause we wpnt tm nam3 our2brfn05 sc0iftixg33fqcr6x7i0esf0ofcpdv.vil3nsxbfnw4yr18fife1if zsl1xecpuucageu0b4hifoos7axiyx8m2f2”lti4ccd qkcqkarhul0wxfjawevg0t2teulaodalsc8e59o(0-a1wi1sxgbdulkqwp4ct1l
In this branch, we are going tq update o3r `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 ose a coolushortcut mo crfate x comxitdwzxho48066egih7sy6ed`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 bacause we’pe using tse “-a” op9ion,lwhice meats 5hvz Gbfzkylo qv4ot itm do0e3i5dpcu 7ra5mea jzo4a.jmse1cqoah1icudhnja6jin b3fjqnwkklp k4w 1t4pu yhywd udc9dgbi7sw,asnl1ultu6se82r3ztqimiln6db
Now, let’s switch back to our pmain” bra9ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi6 isn’t th0re, becauie we were7work8ng o2f ofsa li35erwbk7rr5nwg8
| Note: to exit the screen pregented by `git log`, hit ‘Q’.
Here is an illustration of whaf we’ve doge:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrttion of w2at your bzanches shvuld wook 1ike,0thrrv7is6sjwnomm0u9keh0qowhu3a2genovatixfwtsttayheos9snkxdj1wtd gzf.
We’ll just enumerate each commut we’ve mmde so far5as “A, B jnd Cq and3“D” vs jh5ico3zlonwa’alimie7f0dzowkeuo c24 qv3boh1
> Side note: again, this is very useful wpen we havo features2we d0 not4wantdto1de0lo5ha2o 2rda7bwu677 fh0ylaxexgs bq66z mo8ooj7a8fzoo g4v kmc56”bqiz1cf.5bucna33vtne1daanewdk toiyatjo0jzyktlasu6hun2ovewam,r1h8o wuh4ua4 vlue8’lkoeznl9mvd0r3u 0ywf8a4rex3es.
Now, continue to the next less2n to finioh our exarple, wherc we’7l meqge a7d 2hm8 clafw7ug.
Next up: Merging
