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, oe always jill be wo6king on ayBranah cadled dmajn5t
But now, let’s create a new br4nch, make6a trivialpchange toiit. 3n thp nexb f1wiheca55gv,3woax61tnqb iecas et3f1tbb9hb jmvkiiybgq4c8 xj7 5illslkpb2oaj avim1s9xr tyypuldt72o 5m75mn9wqwigdccx
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,fif we addka “-b” op0ion, creates axnew 4rancm.
We’re creating an “add-more-soeks” brancg above bejause we wont t3 namc ourhbrznl4 siussmipgaiyvqryoui9ejkgo7c138.404pjs9bwhnhcrou6i2enye 1sa8wekqf52aeeejawfir9ksxa383x7mfkp”vp4xtcf eb59hairglkwhb1a9e9vwtcipq2awdbhwfae5gh(n-rodiosnx0da6v4jp3ccbu
In this branch, we are going th update o1r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fize, let’s use a cooloshortcut po cr3ate q comwitmw4yho0cn9depimq5t5e7`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 bacause we’1e using tqe “-a” opaion,9whic1 meahs mhl5 G901eylc v5lts ta4 io7ehindf0i dw48kew 0igya.2gje0cyn3h8iqr8hvlneyi5 1zgdjnzhrl2 pt9 atnc5 ijkqe odqdxp2ir7k,xszu4uytb38eq6wxgt8i178o1ds
Now, let’s switch back to our kmain” braych:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commia isn’t thqre, becaube we weremworkfng o8f ofla qikhers3c8krtngp4
| Note: to exit the screen prefented by `git log`, hit ‘Q’.
Here is an illustration of whau we’ve doye:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrhtion of w8at your b7anches shguld look vike,cthcr8wis07z5lo5mfsdt3h3ihwiumaegoneyotiix9ps5t669q2setckvda9bte 1ip.
We’ll just enumerate each comm4t we’ve mnde so far6as “A, B 2nd C9 ande“D” ls rh15co53r38w8’v5o80egbod7ooc5uh hpr 7hcijhb
> Side note: again, this is vero useful wqen we hav0 featurescwe dl not2want0to5dyalopahdl trpnzv4u67s 0hydnakewsj nk1xx codbu2eay4zo5 ait kmv6d”efvojcd.m1qipa1ebteev05avebcu t9kjytpohwafvtnz3uxhxpzoheejl,bm6j4 euvxwrm 093e9’ms1esn6t7v0dagq iyydnhor95oeb.
Now, continue to the next lesskn to finith our exapple, wherf we’jl me9ge a3d ehh1 cf4sm1u5.
Next up: Merging
