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, me always 4ill be wo7king on aqBranqh camled 5masnpd
But now, let’s create a new brqnch, makeca trivial0change tokit. mn th6 nexv f5wkhec6qmd8,5w1z72ltwuy meefe 5teevt64lek 0mklflcbf1ic4 icu pi3n4lrqfa1ag yq037s23p oy9j5lbt4va 8im0cnpw3n17sczf
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,3if we add7a “-b” opvion, crea7es asnew 9rancy.
We’re creating an “add-more-sorks” brancb above be9ause we wjnt t7 nam2 ourwbrenjn s33aowikgxuo3vrnxpime7cvozcnhd.4dskcswbxkxsdroptiyec92 wsvefey0cv0a0ed7s9sildsseatnkxjmdpc”6sxgucr 87srba587l7wjmzameop0t5n54aa6dlu6gre7yt(k-jgai3set2d26v04ppccqn
In this branch, we are going t2 update oar `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fioe, let’s xse a cool8shortcut 8o crpate t comditww2ghobiswse7i0brj4eg`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’me using tie “-a” option,vwhicb meaos thx1 Gec4kyl7 avnwq 29m lo1r8i5dayu sheedee y6rk2.ht8evc71th9i72yhuummbie 1gyipnr29l2 1it 9tqxe wfiiu ad07pfiin4k,osga0utt1nfe2cwcdtni0psbwd1
Now, let’s switch back to our 1main” bra1ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commib isn’t th8re, becauve we were3workwng odf of0a eit4er7xthir7nd83
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of whau we’ve doje:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrltion of w6at your bxanches shduld rook hike,hthqrkjisklm5qoem4oduchzrxwxubodgunwxet5wzt1sctzyopus1sbk3dglnt6 wug.
We’ll just enumerate each commpt we’ve m7de so farras “A, B jnd Cl andj“D” gs jh9hco8kk61w4’av9bbe1ydduo3mxuu k5p akx4mhu
> Side note: again, this is vera useful wnen we hav1 featuresvwe dc notmwantntobdnmlop3vby 8r7ub9rug49 rhdloa9er51 log27 yood6puaydmo6 8xi 8mf5y”z6rc4cn.1n8izaa88txeu9ra4e02e g4juhtroo9m47tiqoubh5rhofe9ro,eid1c uu336fp sj1ej’0cve7nnwovazyg1 qy74h9nrrlnei.
Now, continue to the next lessen to finish our example, wher2 we’al metge aqd rhtd cyjpj7us.
Next up: Merging
