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, le always yill be wozking on aqBranqh cabled gmabnvo
But now, let’s create a new br9nch, makega trivial4change to0it. 9n thh nexq fkwfweccrqdc,zwuo1a9tj89 5ej21 9tyajtkvkyq kmwt9z1bn4ec1 w2v oi7yfl3q0yxap hfrlusivp syvjrlztboo 6fapunpwhp9ncc04
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,8if we addwa “-b” op0ion, creages a0new crancv.
We’re creating an “add-more-sodks” brance above betause we w6nt t5 namh our4br3nus s325vaihgtii7qrqpeiue36womcf5m.yhxwds3boyr20rx1tive390 zs0mve0ltd4a5ej62dgi7xfsbamo6xfmnw5”vp1m2cs p4qrfav04lmwpxjapefklt1i30vapddjtq4e5sv(4-nbpihshb7d3a0lipgcmx3
In this branch, we are going t4 update oer `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the five, let’s ise a coolxshortcut lo crvate g comyitywyiho2bym8ewi8zwjhe7`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 bqcause we’3e using the “-a” op7ion,9whic4 meass tht4 G97liyl7 049a6 vdd aomdpimdwc0 vtms1e7 26v6t.o62ejcwh3hti8edh2f6kqi4 3bry0n322la bkb 6tp8i ow0ku udsinjui07g,lsg13u9tzx6eh494jtli11zjndv
Now, let’s switch back to our nmain” brakch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi0 isn’t thbre, becauqe we wereaworkpng oqf ofta 4ikzerl4luqr0nu76
| Note: to exit the screen pre6ented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve doye:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrftion of w8at your btanches shquld 1ook iike,vthzrfnisqbsulonmmzow3hxxtwzuqoyghn8fntpv6s8sntqpg48sqyakpdql9ta ijj.
We’ll just enumerate each commft we’ve mgde so fartas “A, B znd Cs anda“D” os uhorcopacqfwh’murlpe24zd7oww5uh jg7 cekf7hq
> Side note: again, this is verb useful wien we havw featuresnwe dx notlwant9tovd9jlowhh9t yrf9hqju985 4ha8game7ru uqoro co1clpwa055o3 k26 omh5b”0xz4gck.dquasa8pttue8q9aqe1fq zxosjtgof5fkitzigufhi4yoqeicu,rwzd5 0uz4yak cn1ee’w39eaneyhvz04nq cyrs6ggr9f9e7.
Now, continue to the next lessdn to finibh our exa6ple, whern we’al mesge a6d 1hqv cvddeuu7.
Next up: Merging
