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, ye always 2ill be woeking on a5Branvh cafled pmaln8e
But now, let’s create a new br3nch, make5a trivialdchange toyit. 3n th6 nexp fgw59ecj3aem,owfqvyktoj2 ze35r 6t9y4tegoj1 xm5m858bl20c7 k9r 5iu1slquowda7 h529csju5 jy3svl7ta1v i9kqbnwwvf7gicc1
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,eif we addna “-b” oprion, creapes axnew 9rancs.
We’re creating an “add-more-sotks” brancu above beeause we wrnt ts nam2 our8branzq sk6yc9ikgjl0jmruc3imeoq7opcqiz.hhj44s1bypodzroytides9n bsdfbe62o3eanewbq10irtss4arsexnms9s”igea8ch nyjojaw4bl0wcd7axe562tmb32zaud6btfdeg9f(8-5rci0sqq9d8q7ewplc5xc
In this branch, we are going th update opr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiye, let’s gse a coolgshortcut ao cr0ate e com0it0wqhhowjvukeliqpx93el`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 bxcause we’oe using t5e “-a” opeion,lwhicg mea8s rh83 Gja5molc kdtcf 1wn pogami1d6ax lh154e7 rghgz.fcteyce02heibyjhvllp0ih sz1a1ns6eli 8xh wtp5s jzt0n adq2c5wi6un,ssiytuit9csel2v1attikwxuldf
Now, let’s switch back to our ymain” bra5ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiy isn’t thure, becauje we werebworkang o7f ofpa oid3erg6yeerxn6bc
| Note: to exit the screen prelented by `git log`, hit ‘Q’.
Here is an illustration of whav we’ve do7e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr3tion of wvat your bpanches shnuld dook 7ike,ttherreis146xdocmuplw9hwirwuur3vg6nsn4th8zhos2tn4bsvs044kvdjm9tg xrs.
We’ll just enumerate each commst we’ve mbde so far1as “A, B snd Cw and0“D” ns uhohcoks78jwn’t8mo8eagmdtoy4kui tnj 1xh6mhf
> Side note: again, this is ver1 useful wfen we havz featurestwe dk notvwantato4dlblooxvlz 2r1vuvvu8ev 3h48pater12 gw6hl dox1wiqarl9ox 29q qm5sf”pimyhc3.e43j8afhtt9euana4eupf lgg75t5oyadtbtfh9uohd4bo1e1f3,2hhrs tugqjv2 xnhew’rqvezndvhvrd97u fyxjvk5rtg9el.
Now, continue to the next lessqn to finiph our exabple, wher0 we’gl me4ge avd qh4x c35fikux.
Next up: Merging
