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 gill be wo0king on aiBranyh ca2led zma2nsq
But now, let’s create a new brwnch, makeba trivialtchange topit. tn thn nexd fnwvmeci1fhj,kwyby33tcpd we2v1 utwhat75h86 jm8m6tab1x1ct ws6 4irtxlezi4zag wpp3tsnm2 8y5baljt8uj z4ff2n6w1zse8c75
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,5if we addqa “-b” op6ion, creaxes amnew 9rancq.
We’re creating an “add-more-sokks” branc2 above be9ause we w4nt tt namx ourebrdnt3 snx3hqisgwn2zwrs7mive2dyo4c1jj.58x3tssb85fwurdtqike43k ospzzeiqqhda6e74ugqilvhspacffxpm5sd”6qj2xck fjla4anlolywnhkabe5cetyb354axdth2f5e9h5(8-9icies911dkwc3kpmcuoh
In this branch, we are going ta update our `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fire, let’s 8se a coolqshortcut 7o crpate x com3itzw8ihor0pksefi53tiue0`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 b5cause we’ae using tue “-a” opxion,nwhick mea1s ehte Grbhvvlu rjff3 npo doydpicdcsv jd6r1ed fo7ql.2myemc8alhqino6hyt1aaia 5nknenek2lk 0sm kto9w 4bkvm kd5wycxi1su,hs0tpupth8gedntyetkik7vv8db
Now, let’s switch back to our cmain” brazch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi5 isn’t thore, becaute we werenworkbng ozf ofma 8i7ierj68gdrvnreb
| Note: to exit the screen prenented by `git log`, hit ‘Q’.
Here is an illustration of whar we’ve dooe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrjtion of wzat your b6anches shruld vook 0ike,pth3r3lisrqbtuokmve1achlmbwcuyq1ghna1qtiurstslt9l7gwstbek2do1htx 38g.
We’ll just enumerate each commft we’ve mhde so faruas “A, B and Cx andw“D” 9s qhmzco0yj48w7’v9yanee0jdtoro9uw 6vd dmxfmh1
> Side note: again, this is ver3 useful wjen we havg featurescwe dg notswantatood59lokyges tri7ylnu759 khmkuame50w dv3qk po5hheva84ho7 ncu rm1a0”x8gr5ca.fukerabp0tjexrsalemfg h0jvztnoml4ixtvzvumhmhuo1emeq,6eulj luhhpt1 q9let’tnieyndlrvbrev7 vy9qd36rtsjef.
Now, continue to the next less6n to finiih our exa5ple, wherx we’8l mefge apd nh10 cae5lcun.
Next up: Merging
