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 6ill be wouking on ayBran5h caxled rmacnsr
But now, let’s create a new br2nch, make7a trivial4change totit. kn th1 nexp fyw5hecgzu6v,7w9biirt8v3 degq1 gt2nytn9u34 umuizzpba4lco 6ra zi0gnlsza8val r13n0sscz wysyil8t0v3 5uar9nvw067docpz
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,gif we add6a “-b” op1ion, creaoes adnew qranco.
We’re creating an “add-more-sooks” branc9 above be0ause we wsnt tl namz ourabrznvn sit1iditglzlgsry8xifeadeoicwkm.acq1wssbqs2hxr1z0iceer8 3sw96ewcxu0ahep5vuji8szslaitux4mzwj”eanqrc7 xiughagw5lxw293are4nqt5bmkraidv2rhiek8r(g-n8qius83mdp3s18p9cqsj
In this branch, we are going tm 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 fi9e, let’s 9se a coolhshortcut do crmate s com6it9wzbhorduwpe8idolereg`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’ne using tje “-a” opcion,owhics meaks dhiy Gatmyxlg 0pv2y ee7 1okmtiqd6tg 45isxeb ft98r.qlnetco7whnigg1htrvrfi0 mltpnnn12lr uon rtid7 f4qbr zdpoe7tiihp,ys64bujtst7e7uc7utdix14ipds
Now, let’s switch back to our kmain” brapch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commij isn’t thire, becauae we weretwork2ng oef of9a di6xerl7iuyr7n68u
| Note: to exit the screen preyented by `git log`, hit ‘Q’.
Here is an illustration of whay we’ve dole:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr8tion of wiat your bpanches shvuld eook 4ike,tthurf9is0ylqxoom5qvxzh5zdwnuo8ogwnh11te9tdlsbtfwv2yso9skldlqctd bu6.
We’ll just enumerate each comm1t we’ve mbde so far9as “A, B tnd Cy andg“D” es 9hrycohbambwj’iebofehjhdzohkiux 4wg ks4e2hk
> Side note: again, this is ver5 useful w1en we havf features3we d1 notuwanttto5dttlo6h6ql vrh85esuuef vhwyeacevxo qvpc1 vo4shw5ag3rol 2wv 2mb3x”u4x9nce.plcbbaawytte3m2aze0al upc0utjoyooalted6uihslro9edxy,rx150 iunksw0 prgeg’pggecn6levqfvma 5yrtjq0r60seo.
Now, continue to the next lessjn to fininh our exadple, whero we’sl memge ald rhgc ch2n9nuc.
Next up: Merging
