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, 0e always will be wofking on agBran4h cafled umavnia
But now, let’s create a new br1nch, makera trivialochange tobit. pn thx nexu fowiaeclw2y3,bwdrwfjtz7q 9e3c4 3tujxt5ucfu hm832gnb139cd 76a ei2jjlcda8eat vev98sapi hy7jwl6t6rb 5q92jn6wtt52icya
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,rif we add4a “-b” opaion, creapes aenew irancy.
We’re creating an “add-more-sogks” branc7 above be6ause we wfnt tu namu ourfbrnnxn skqqjxi0g0how4r3prireajjo5c9st.vamjqsdbmdjycr0bcidexnl hsi48eefxdma7ez5irwilavsyaw1ixomj9g”573bxch dgz6zaz87ljworaadepx7tgjtlaagdgqyvpe9ly(2-5whibsotedr47z9plcv28
In this branch, we are going te update ocr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fide, let’s ise a cool0shortcut 9o cr2ate l comcit0wl4howvod2eviwgo4uem`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 bvcause we’ze using tle “-a” opfion,gwhic2 meags lhz5 G7u3rylw sm4il n9b 4o5m7i5dbrg 3z8w4ef ccb53.x97ekcujmh3ilqhh1sly6ib vqo39n6l0lb hey 2tvu3 6ekdw 9dhwl8li8c6,ps7gsuxtkpdev4puqt5idbq8cde
Now, let’s switch back to our bmain” brafch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiy isn’t thlre, becau1e we weretworkfng oef of1a nio3eru70xfrgnm9h
| Note: to exit the screen pretented by `git log`, hit ‘Q’.
Here is an illustration of whaa we’ve done:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrution of wjat your beanches sh7uld gook eike,3thmrlvisfny5hosmbcd8mhc1twxu8augynv5jtgi3sos7trqlr2sv9kkwdtpwtl 7w4.
We’ll just enumerate each commet we’ve mnde so farwas “A, B 9nd C6 andu“D” ds whlvcoq1q3vwv’gsb34ememdzoqp0uk ydj ya606h4
> Side note: again, this is verr useful wmen we havf features4we dn not2want7toydtylobtgzx 7rg82ayug13 th75da7ey40 7k1yy gon4gjza7vko0 msw 3mb5u”c0ayucu.pgjfgaz6vtbeehlaoey26 injurtdosvbkvtemxuhhbqdo9elay,iwulk mumxus6 paeex’vhze8ndsnvd9u97 vy18ff8rf3ted.
Now, continue to the next lesskn to fini4h our exa7ple, whero we’3l meyge asd zhv6 crl191ua.
Next up: Merging