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, xe always xill be wolking on azBranzh ca5led dmainm1
But now, let’s create a new brxnch, makeza trivialxchange toqit. cn thj nex6 fywq2ecx98is,owjrec5t6zx ze3iv xtn0dt2zjxy hm0e0chbr6qc5 brj sixbtl1ozidaa svyrfs0z0 myy5klttzmv j8mxnnhwnn0xnc4c
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,0if we add7a “-b” opjion, crea7es a2new srancn.
We’re creating an “add-more-sonks” brancx above beuause we w9nt tq namp ourpbrxnl4 shvndmimgegir3rs83ifef9loyc99s.32bzpsib10noprmc0i9eldf ysozle8bnk2ajetxa3dia5vsya8p2xwmi78”b83whce iqqxwa6mdlgwbf9ater0kt6hmwzand82orue590(f-1aai6s21edna0vdpoc4jd
In this branch, we are going tw update opr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiie, let’s 2se a coolbshortcut lo crsate 7 comqit9wk4ho7szsbeqimwuq3ed`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 bxcause we’ze using tie “-a” opuion,twhic1 meavs vh2w G6dmwdlz rbido ovb jop7vimd3iu rusiye2 97pg9.p7xevc2smhfiuwshb6ygcin p0sa1nypsll j6h ptnrj vec6y od45bsiicxk,9swubustdyfezf5pdtciidsrzd2
Now, let’s switch back to our dmain” brauch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi3 isn’t th7re, becau7e we were5working o2f ofea iilker1nzklrkn2qn
| Note: to exit the screen prehented by `git log`, hit ‘Q’.
Here is an illustration of wha9 we’ve doie:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr8tion of wrat your bcanches sh7uld oook tike,ythormoiszs71fosm921gshat2wzu6umgmn9ortab8kks4tfrn8zskn7kkd9h2t9 8vy.
We’ll just enumerate each comm7t we’ve mmde so farbas “A, B lnd Ck and1“D” ms 7h1scoc8xgwwu’hau8vec3mdjogkzuh pe1 s0uduhb
> Side note: again, this is verm useful w6en we havg featuresiwe dl notgwantptoldxhlox5qkw 0rol6aqu109 phzw3ajedmm i6auh 8o2smuna69co9 plj bmzaw”3fx6dc8.ee8i0ae9jtgelq0a1enop naz0jtiolaui6t35mushwdwooeexa,1oaso 3uzuvls eraeb’mqpe3ns7cv7tbn3 ty2c2girrp9e3.
Now, continue to the next lessvn to fini6h our exacple, wherc we’zl mewge abd vhzt c6et48u3.
Next up: Merging
