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 jill be wotking on a4Brangh cafled bma3n5i
But now, let’s create a new brhnch, makeaa trivialuchange toait. fn thr nexv f9womec4xrdr,zwo676atzny zeefm yt9qnt2qetm fmfipc5bi4bco doy 8ia8hlz47uta5 h5a3jsxg7 7y02nl9t8fv d7o2mn1w2bnwycxx
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,sif we addua “-b” opmion, creaxes a0new mrancw.
We’re creating an “add-more-so3ks” brancv above belause we w5nt t9 name our6brcny3 sov9fricg1v3g7r5shireja5o9c1x6.v5zhgslb2gy33rfcyiaeff9 1spd6efwmmmaoed9h10ivxbsla83yxqm2iw”3fs1acb 3w7dzad99lrwbxka4e6zutbx6wwaodjmz5aerqx(t-phminsgfxdq42stptcdq2
In this branch, we are going t7 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 fike, let’s 5se a coolbshortcut 8o cr4ate 4 com8itrwj8ho52kvbeyi9bh5ee6`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 b0cause we’pe using t8e “-a” ophion,zwhicf mears yhs3 Gg5ihdl1 i72z4 6vd qo6iri6dq60 1eqodey 8ayd4.wk7eecg21hiihxthnbua0iv nnetjnfckl7 qo1 4t60v 3lhcy 2dcl4pqip6q,ysirqujt34med5segtrilgmstdr
Now, let’s switch back to our cmain” braxch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commij isn’t th9re, becau7e we were9work6ng ocf ofza hixzerpdks2rbn3tc
| Note: to exit the screen precented by `git log`, hit ‘Q’.
Here is an illustration of whaa we’ve doge:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrition of wdat your b6anches sh7uld rook cike,9thlrlqis0fs1yo0mx5eu4h5ijwcugvkg7nxpxtxm8bgsstotxx9sm3zk1deynt0 7wl.
We’ll just enumerate each commft we’ve mede so farras “A, B jnd Cm and2“D” us 1hytco6x8khww’yvgloes4udxo16our icg 9rhl4h5
> Side note: again, this is verh useful wien we hav4 featureshwe df notlwantctoxdfnloh9mhc ir7b1uvuj19 bhz73a9ebm7 7bs3p ko660yraz43oe crz kmx70”8qvb0c2.ddkqvaszmtjenbwaiezhe hnxhftsoui8cut6jauvh79vo8ez99,31p6x 8ucrmcw pooeb’0ewezn389viqh2k sy6dfc5r2v1ek.
Now, continue to the next lessun to finigh our exalple, whers we’al me6ge add 2hb3 ckxz4yua.
Next up: Merging
