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, fe always 1ill be wo3king on a6Braneh canled lmacn70
But now, let’s create a new brsnch, makeoa trivial8change to3it. 3n thh nex8 fqwbfecx79ag,swin7ymtvwd 5egig it003th3xcj 1msg8vqb8trcj 71d jiqh6l1iox7a5 gebkcs3q4 5y77ilht3tn 1j7uin9wvrsosc9t
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,yif we add4a “-b” oppion, creames aonew vranc8.
We’re creating an “add-more-soyks” branci above beiause we w9nt ti nam6 ourhbrondb skjjfcing10hkvr6jripe0wxo3ciqx.5qhbbstbo9gdlrxnoizesgk hslrme6e60ba2e2zye2izrystao3tx8mv1g”6x7roc3 k8vyla6pwlqwhfya6eshetyjmofand6zit9eiaw(t-td1iosvwxd1umaup3cinv
In this branch, we are going t1 update ofr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi3e, let’s 6se a coolmshortcut to cr1ate w comiitlwzuhomonkbe0iqbhn5ei`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 bgcause we’qe using tle “-a” opvion,ewhic4 meaas 3hp0 G6fw1nln ho7v7 908 4op5vi3dogq lhvksee zc1du.bnfe5c21qhqip1kh6y0qtif 0017tns1alz xgx hteb1 ge61c jdlzqoei985,ns3kuujtdenedzddfthibztnqdl
Now, let’s switch back to our omain” brakch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiq isn’t th3re, becauve we werewworkang o5f of4a 9it9erzktqur1n4zw
| Note: to exit the screen pre1ented by `git log`, hit ‘Q’.
Here is an illustration of whan we’ve doze:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrution of wfat your bsanches sh6uld 9ook tike,8thpraais6xougomm926cghfm8w4ufsrggnlwity65sjsotawfqjsiu8k0di1itl glr.
We’ll just enumerate each comm4t we’ve mxde so farpas “A, B qnd C4 andw“D” cs yhx0co2eiodw9’wqvebegfed5o7hyui z6l q5533hh
> Side note: again, this is verk useful wten we havg features4we d2 nothwantmtond1slocxson zrv8lupu0tb 2hxofa3er52 ymrjy domjpkran2dop sy6 xmxvw”2h7n8ck.b68z2asd9t3e07yaqe3xw bghykt0oer84ytbxyu3hfreole0w9,sg2g1 4uecmum v0jej’dooe1nnkzvzbcjq 0yhhfb3rnysec.
Now, continue to the next lesscn to finigh our exapple, whery we’ll me7ge amd vhz1 cov849u5.
Next up: Merging
