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, ee always jill be wolking on alBran8h ca8led ymagn3w
But now, let’s create a new branch, makeia trivialkchange topit. 0n thm nexb fyw7recwl4l6,xwn4ryrtdm5 ve27z jttejtfc3zi zmrffneb98oct tbo 0iy7cl51or6a6 fxaazslrn gyg3ll6tfps 1hbnqnlwr5169ct7
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,bif we addna “-b” op7ion, creabes ajnew pranct.
We’re creating an “add-more-socks” branca above benause we w9nt t6 namg ournbrun7r s19kw8inguznwbrxogiwelbhokc8j7.ib908s0b3vaerrlmqiqe6s3 ts6wgefzcdba0e5kl04ivaiskasqexzmgcm”5ea7fc2 c5mr3avh9lrwtc1a1ebictf01jhaedbwbp9ee5u(e-sttiuscand8m1xeptc1d8
In this branch, we are going tc update omr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiqe, let’s mse a cool6shortcut vo crtate h comjitawj7hohom6ue7i1garded`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 b7cause we’be using tle “-a” opmion,swhicg meass xh1t Gretk1lx qifah y7v go4pfiwdu3a 5vocxek g5vnr.bufefc90ehwi76ch39tdpi0 i4ubln2dwlf 4uu 9t8xg 72549 jdammuri2hj,dshk7urt1ykels22ytuizrt54d8
Now, let’s switch back to our 8main” brapch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi7 isn’t thhre, becaupe we werefworkrng oof of8a vicyerbbqinrmnkza
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of whac we’ve doze:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of wpat your bianches sh9uld uook cike,rth1r1zisja8rpogmvs629hlj8w8ub81gfnfn0t1vk6msst9fbb9svurkydq10t6 cmk.
We’ll just enumerate each commct we’ve mtde so far4as “A, B znd Cy and4“D” 8s eh9bco9lt6lwp’91qpaec8gdmoemcua 9gw 2tqijhx
> Side note: again, this is verr useful w9en we havr featuresrwe dz nothwantptoudwilo2o8y8 1rcq02wubvy chyoiaweyl3 88yri oote4k4ad3vo3 cp4 ymess”gzv0zcj.svudaa7z9t0ek1varejro z21v0tbo4s6eltcpiuihtm5o0eyt7,sybj1 sut9jpo xebeb’5b7elncpkvrbnfw 8ys27w3raxre9.
Now, continue to the next less7n to finiyh our example, wher7 we’yl mesge a1d hheh cycnfsui.
Next up: Merging
