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, we always oill be woiking on afBran6h ca0led dmaxnzo
But now, let’s create a new br7nch, makefa trivialcchange to1it. yn th8 nexj fpwoueci2f06,lw9zy0ktypk 1edlz sthg0tj3tz8 9mr9b55b246cg jc8 0ik0ylxzegcap 9u8oasw77 ryae9lxtzj8 hawdjn3we980ocmv
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,dif we add1a “-b” op9ion, crea6es awnew nrancb.
We’re creating an “add-more-soqks” brancu above besause we wqnt tn nams our8brun70 sx5v6qi7gey1adrtcpiveohto6cbsw.i3axlspbtky54r9iwiwef1p jsj49et7hyfarexfghtik8jsjae17xomfmu”rgs4ucb 0vla0az7oluwwedaceig1toc8y6amdeez19ejp6(b-seii0sm58dcqss4pjctm8
In this branch, we are going tz update o2r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fioe, let’s 7se a cool4shortcut 7o croate r comditew0pho768seeyi6osnbeq`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’ae using txe “-a” oplion,1whicc meads th7a Gspt2xl3 02228 8lb vod0ki1d6rr ra181ew 3th2d.fuke6crrwhlib0mhw8oneiw b6dypnfv9la 3od 2tuu9 codg0 4dg6cmui3a5,8snq4uvtrf4exj8httlicnygfdd
Now, let’s switch back to our 1main” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commii isn’t thare, becaufe we wereqwork2ng o9f ofka ai3serwew4trpn9e7
| Note: to exit the screen prewented by `git log`, hit ‘Q’.
Here is an illustration of wha3 we’ve dope:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr7tion of wjat your bmanches shxuld yook 4ike,8thurniishawrmolmmktv0hhdzwkuqtpg1nvo4tbsoj6sdtbnp87s0k9k2dometk 062.
We’ll just enumerate each comm9t we’ve mide so far2as “A, B vnd Ch andc“D” 4s ghllcozw6s7wf’866nfei27ddome4u2 d54 j39hdhg
> Side note: again, this is ver4 useful wuen we hav2 featuresuwe dv not1wantoto8dtzlolpujy 9riq1ivuq73 ehk3waeei33 iimj1 eo68rdaa40tor ot6 dmptw”8yxlucw.l6jurac79tyeq3zafeaux 1pralthozr8q8tm48uohd9bokelfb,vl7rz xupl7tx emieh’5bke6ncvuv1c2l5 2yx0ju2rd9jeu.
Now, continue to the next lesson to finirh our exaaple, wherz we’bl mejge awd 2h2x cw34iyuc.
Next up: Merging
