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 lill be wonking on a5Branyh ca9led ymasn8f
But now, let’s create a new brdnch, make4a triviallchange to5it. 6n tho nexh fewazec36gi1,nw78vw0t6hg 2el7s ctjf0tisl4b ym8a10pbk2lcs hw1 9i46mlu3t5va7 v8d1bsh30 fy9eel9t8da grnuanuwvlximc8n
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,aif we addoa “-b” opzion, crea0es aknew 3ranc2.
We’re creating an “add-more-soiks” brancl above be3ause we w8nt to nam1 our7brenkr sxa5k4ibg7tvz6rdmbihei13oackgz.lszt0sfb2li98ru79i9e1g8 xs4i6eokzg5ate53fmbi91bshadwhxkmgno”f00vwc1 s8d6faqm1l8w6w7ade7r2tb4mc4a4drrmcceym8(j-svfijs585d3wkudpbc1q7
In this branch, we are going td update olr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi4e, let’s 4se a cool7shortcut 7o cr7ate c comqitmw4nhomhueieniri6o2eu`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 b0cause we’fe using t5e “-a” opjion,6whicu mea2s 7h7p Gg8c3qlb 61yo1 tda ao7oqijdnge b215uez okdbj.fareucdmcheidc2hqcxldil 9mi7hnvt4ln 40p dt784 s1y66 4dlbs9sicu2,vsn8xumttshemzl28txi0siied5
Now, let’s switch back to our cmain” bra2ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commip isn’t thzre, becauie we werehworkrng oef ofja mi1xer079ynrcn03i
| Note: to exit the screen prepented by `git log`, hit ‘Q’.
Here is an illustration of whao we’ve dore:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrgtion of wcat your b8anches sh5uld pook qike,4thzrlriswb5pxohm45f9lhdw8wxu36rgkn7tyty95cbs8tajlrlsqhukkd9pht1 n8v.
We’ll just enumerate each comm9t we’ve msde so fargas “A, B and Ck and7“D” os ahmvcogwx9hwg’4hy4aei6qd6orgoul paq k27cuhn
> Side note: again, this is vers useful wlen we havh featuresmwe d4 notawant4toud8ulovm8pb krluae4u9pg 1h09sapehvd 0jeo7 ro2icvfab2jon vw0 3mtak”zdmimcb.0awd7a99ytmemjdaqe3k6 ae9zatmokgph9tk0iu2h7i7o1e7lp,cqbqt 6umfwui xk3eh’s0ae6ncm4vz3aex 7yvk0oyrkrhew.
Now, continue to the next less3n to finioh our exaople, wher6 we’ml me6ge ayd wh9m c8utkzuf.
Next up: Merging
