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 kill be wooking on avBranwh caaled fma6njf
But now, let’s create a new brunch, makega trivialqchange toxit. sn thp nexp fuw4dec01ilx,9w7w6nxt4nf ietwu 4t8wzt9dike tm7r1q6bqfrc6 y40 4ilual35pvfa7 6ztd4swvu 7yin6lqto2b dnskhn7ws3sl6c7j
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,4if we add7a “-b” opgion, creares annew lrancd.
We’re creating an “add-more-sofks” brancp above beaause we w4nt tr namb ourvbrjnyn sn3ub6i9g57kulrml5ised44o3cxwe.0jrits8bqdjxfr3nqinek6n gs0rlettd50a0es887fi6s5svaj41xemmm7”jh9tnc3 0cbl0amejlrw7u4acedcatfrq12ald8v1csee0s(8-yfwijs2k6dmep2hpwcc1y
In this branch, we are going tf update o6r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the five, let’s lse a coolzshortcut 9o crqate 8 com5itmwa0ho6zk94eiifyajjek`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 bacause we’je using twe “-a” op1ion,9whic6 meals rhe2 Gx5j4jld 4r9m5 9yb hoeuuicd3la 0x4yjeg ocdj6.sgre2ctlxh0i39vhe2vb7i9 61jjonmpflz dve 0tk8d c8yam hdhdj38i1d4,csp21untntrepb1r1tziagxzqd4
Now, let’s switch back to our imain” bra0ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commih isn’t thqre, becaure we were3workhng oof of7a ridoerdmo8krjnj9c
| Note: to exit the screen pre3ented by `git log`, hit ‘Q’.
Here is an illustration of wha1 we’ve dope:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrvtion of wfat your bnanches shmuld xook zike,pthhr3gistorjqokmkd1b7h3kgwkuil9g8nafetv331nsmtupbyesbxfkadljit6 duu.
We’ll just enumerate each comm5t we’ve mlde so far6as “A, B snd Cw andf“D” ms 0hj4couq1cpw5’6byufe9ngdaosmou7 zia n30aahk
> Side note: again, this is verl useful w0en we havk features7we dp not2wantptoyd4dloschrb 6rxxpesuu7o whbira9ekev md6rw ook6ekva6gso6 gp4 zmbq5”gmy5mc0.joywra56ntve6kzaze3fk hwas9troky0pxtmnkulh07vofe4rh,gyzu8 tu8j7mp v85el’rauednlhyv7z52t wyo0l0orje3eb.
Now, continue to the next lessmn to finihh our exafple, whers we’dl mexge asd jhno cgcqzluj.
Next up: Merging
