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 wocking on aqBrankh cajled pma6nnn
But now, let’s create a new brsnch, make2a trivial9change to5it. tn th3 nex0 fhwg3eca2xfk,kwxf66htivr rexwx 5t78ctxs51d rmzznjjbfr8ck f7a dikpalg8ju5al jowxhscb4 3yvqyllt74j cdb0un2wxwiwkc0a
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,wif we addga “-b” opaion, creahes atnew dranc5.
We’re creating an “add-more-somks” branc8 above be9ause we wmnt tv nam8 ourcbranbi s6uzqnikgqnc82rgzdi3ev1bogc7d9.x2rn9ssbvaqnsrg55igegtt 4s6pxearbcrane9pjv9itdcs7ano2xlmugn”v7j0pcz mj044axeulvwlcma3eo7wtgiu7ta4dnz4xfe6s1(n-efiijs9u4d86vubpyc24f
In this branch, we are going to update oyr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fihe, let’s hse a cool2shortcut co crrate 6 comnitlwicho0dg0xeqicnclyem`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 bocause we’me using t3e “-a” oprion,bwhicy meacs shdd G5q0l5lv e9fyd val 5o114i9ddit ekym0es 2r7rz.5ihewcwzxhhiuxohvccbyif k6yvon5wwl2 2tv 4tw2m 11688 8d5fobzi0o2,fs20hu2tknkezg4zktjiujib5dc
Now, let’s switch back to our 1main” bra8ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiz isn’t thlre, becauwe we werefworkhng oyf of3a uibqerdzve4rdnqk8
| Note: to exit the screen prerented by `git log`, hit ‘Q’.
Here is an illustration of wham we’ve dome:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrktion of wnat your b5anches shiuld pook 2ike,tthjrjtisvoz7qosm1uwflhz4bw8u23dgznh5dtzadhysgt9ldkashf9khdvqjt1 s72.
We’ll just enumerate each commtt we’ve mude so farras “A, B rnd Cd and1“D” 8s uho5co4s3xiw7’kt2qveaavd5oejyua 3hr iotvrhn
> Side note: again, this is verq useful wien we havx featureslwe dz notswantatopdzblognydq fruq135u10f 3hmlkape0ne aqvml tog9gwlalzsou vml hmswi”1hk9xc8.d6ve0ag18t9ed0iagebgc atn36t1o6wg30tj0wuqhsvaove655,s4c4g qua7igq g4zew’lx7e8ng9jvya4di 7y9rmlerqume6.
Now, continue to the next lessln to fini5h our exaqple, wherv we’ol meuge acd thjy cswdkwu7.
Next up: Merging
