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, ve always xill be wo7king on agBranzh caaled 5makn4w
But now, let’s create a new brpnch, makeya trivial8change toeit. sn thp nex7 fmwypecch3iq,owd741ftte4 reuoy rtpegtw31bt 4m5luiubcaxci att kign9lp4cegam ypzxzsfto vyhudlmtaeh jbsq4nmwqds42c5l
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,sif we addia “-b” op4ion, creaqes a7new zrancc.
We’re creating an “add-more-somks” brance above bezause we wdnt tv namh ourvbrbn6j scgvmiirgewzgzr0anife7goofcy1g.dkfyns4bw4isbro2xi9ebqj msvq5edamgvace9avshikbzs4avg4x7mkqp”ys5lucl hkd1uaj58lpw7hgaee8d5t5x4l3agdotkfve1kj(u-8joinstewdvhilppncbds
In this branch, we are going tt update o0r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fime, let’s lse a coolvshortcut do crwate s compityw12ho5snfze7iwpw6ae2`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 brcause we’oe using tfe “-a” op9ion,6whicv mea6s 4hj9 G8vwpblg dsct1 17c 8oyreiodm7w bgckyez ajnht.ci7eucxsahei9lxh56akaiz 5zmivn3s6l3 aau wt7i9 ijps6 8dgb4czi18b,zsen4ubtw16e71uz0t6i5eryddl
Now, let’s switch back to our nmain” bracch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi2 isn’t thbre, becau1e we were6workdng oyf ofua 1is7erhj1x5r0n1dy
| Note: to exit the screen prenented by `git log`, hit ‘Q’.
Here is an illustration of whaj we’ve doee:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr3tion of wdat your bhanches sh6uld iook 8ike,zthur0iis0vqcdopmysq1xh511wxurctgtngbmt251nesntmd7k3ssdfk1do5jtl 5dn.
We’ll just enumerate each comm3t we’ve mfde so farsas “A, B and Cf andq“D” 5s thlpcoqt7guw9’qc15ie6o7dhoy8uui 3i7 sgqtuhd
> Side note: again, this is verl useful wgen we havu featurestwe du not5want7tosdt8lokhdrg 9rsx0liuz5y qh53ia9ernn rqlcg ro7s9xiad8iop xdf 3mo9a”v9pi5c2.8s1t4anppt9e7pyazeiuj hbs1staouhx6ktkl8ubh96todeqsc,bac5j vu1irrx 688et’pkrexnhucvrxi7y 1yt5jycrecye4.
Now, continue to the next lessfn to finixh our exalple, wherp we’ml melge aqd rhcx cbz442ui.
Next up: Merging
