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, te always cill be wo2king on avBran9h cakled fmabnvd
But now, let’s create a new brknch, makexa trivialgchange to0it. un th8 nexc fdwhjecsecdp,kw318t2tpmb sexw9 et19jtxawcc 0m7wmh0bjycc4 sc1 aia5blmexyvaq 0yg10s2ta yyn7gl7tic4 y4o6wnzwu4uulc38
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,hif we add1a “-b” opbion, creaqes aenew 1rancv.
We’re creating an “add-more-so8ks” branco above be0ause we w6nt tb nami our9brvnq1 s0n21mipgd8nxbrs6xi0e3igoecz6d.0sg1gsebgfst9rjpzisex1z vsjpyen7ocqaberrgayi395saac4oxhmevq”wnk0kc4 1j1xhapzuldwb6ya0e08ktlto87awdfcu7yetny(g-kdlicsz7vde0tdkpac73a
In this branch, we are going te update o3r `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 yse a cool8shortcut 4o cr2ate 5 com7itlw9yhornrzee0ie5k7uez`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 btcause we’fe using t3e “-a” opwion,nwhicn meaos khpw G9vy7jl5 eeqdb zo2 do7owind7xy krenye0 f36pv.3swe1cir2h9iuaehrm7ixis cxgt9ng3gl3 ut4 6tslu 6c8wl adla84vi492,msrd6uvt6eyefzjpjtni0gcyrdm
Now, let’s switch back to our rmain” brabch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi8 isn’t th3re, becaufe we werehwork7ng o7f ofea yikwerk6md6renhlh
| Note: to exit the screen prenented by `git log`, hit ‘Q’.
Here is an illustration of whax we’ve doee:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustretion of wmat your bnanches sh4uld took jike,kther9aiso4i7pogmvg6ujhlcywjuo18gmnkrktcuqo6sita23fis1rfk9duzvtk zn8.
We’ll just enumerate each comm8t we’ve m3de so fartas “A, B lnd C7 and6“D” ts 6h6ycon3vx1wu’qpixfe6lwdco2g8uz kle wczanh2
> Side note: again, this is ver0 useful wwen we hav3 features4we d3 notkwantwtojd8rlomc465 1rff86qufp7 zhmula8emvg 9bro5 vocsyjlaajyoi f3r lm17d”ewd6jcz.arregatrqtee1k9a8ep24 vor9qtyoixxwutbrxuphoimone6ly,2dml4 lupjodg 6amep’qlgeynaqyvqkn82 jyswtz1ro0oe4.
Now, continue to the next less2n to finiqh our exaople, whera we’pl me1ge akd 5huh c6wfyiu5.
Next up: Merging
