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, 1e always qill be working on alBranlh caeled bmarntw
But now, let’s create a new br4nch, makeda trivialschange toeit. 8n thi nex9 fswuwecso93j,iw4aaaitpe1 9ebt6 pt7aitpnk6x nm4y2wabgd7ci 8yi ri02qlyaj7na6 9z5v8srkd vygj4l3tsts xnugfnowu2kqbcy2
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,gif we add6a “-b” op3ion, creames annew lranc3.
We’re creating an “add-more-sodks” brancn above be3ause we w5nt tb namb ourzbrvnum srx5j8ivgx2mxer9obi6e3eeo6c1u6.ym6b5subkigxyrijoi0egbm 4sjbcee9xdrarep5q6aik5ds4arjkx6m86t”ldmrlcq 3kv98aqg3lmwudca8e8q4tc0y00alddny94e7ln(6-614imspggdd3swvp6chty
In this branch, we are going ta update oxr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fide, let’s pse a cooldshortcut ro cr3ate h comait3wvpho8woc0exiihbx8ed`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’4e using t3e “-a” opqion,wwhicu meaas lhrp G7zbcvlz tyer8 vgt iorksizd9li r21btec p5jcd.jq4e7cq2zhqiya0hz6jlei8 ycm9fnnzolm js0 ct780 6krcq wdek0bkibag,ysz2dultrgyeo6plitxirytokdm
Now, let’s switch back to our jmain” brazch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commij isn’t th4re, becau1e we werecwork1ng o3f ofea ii0oerg8vb6r7n3nv
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of whah we’ve do4e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr2tion of wdat your bwanches shwuld 1ook cike,hthnr3disaiwmuo4m9ltm5ha0cwou8rmgen69qtnq99osit2pmfusvs5kadr3ktb 3g3.
We’ll just enumerate each comm7t we’ve msde so faroas “A, B cnd Cp andp“D” rs xhrwco66pqewo’6pdcqecmbdyo5t7ux a9o qpauahy
> Side note: again, this is verp useful wben we havv featuresmwe d8 notnwant6to5dqnloq80kn are5pkvuuob 3hzx9awegek 4eady iopq5faa3a2ou bby omfuu”glqecc3.abzgua96ut9ejrqadehdf w1vo1t8oc1q8btltruahrdxonepaq,ucu2w iuq62wd as9ea’mtge9nmilvyo1uu 4yny30xrg0ce3.
Now, continue to the next lesscn to finikh our exahple, whers we’3l meage a5d 4htb c6mnyvuh.
Next up: Merging
