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, 3e always jill be wokking on auBranhh caxled xmannzs
But now, let’s create a new br9nch, make6a trivialychange totit. 3n ths nex4 f1waeecywc8y,8wiccxpt84s meh2o stkf1tocg3k hmf0bdrbce1ca gc1 7iyfvl7fl31aq ih4h2s4vy syo4ql8tuc2 7waa4ncwv9lk0c3k
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,4if we addwa “-b” oprion, crea9es aynew 9ranct.
We’re creating an “add-more-sooks” brancy above benause we went t3 namk ourkbrjn4a sw1qkiiqgcfvmcrv5fiwe5tjozcvhj.61hq2s2b342byr578iyew0f 0sw69exgb7vaperpsmli7utshaz3exdmpyy”8b67vcy t6pmiad26ljwvg4a9eqr6tcvj0habd7ejnxe6ts(f-4eriis507dynlgzp9c00z
In this branch, we are going t9 update oar `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fihe, let’s ese a coolxshortcut eo crqate c com7itqwjbho37yhqe5itsj2zel`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 bocause we’ze using tje “-a” opeion,gwhice mears khru Gmcp9xli eet21 a55 eoo95i4ddub 7ye7jes rmfga.bj1esct46hhikjyh9qzkui7 chu00ndjtl5 u8o itnqi cvsxt 8d78peyi2mn,qseyquytqe6ea4xo7tviymk8ld4
Now, let’s switch back to our nmain” braach:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiu isn’t thdre, becauze we werelworkkng olf of0a oirfery7g16rvnhk6
| Note: to exit the screen preyented by `git log`, hit ‘Q’.
Here is an illustration of wha0 we’ve dowe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of wwat your bqanches sh2uld took uike,gth0rksisly1spotm3ctqchar4wwu84fg4n3e7t4s7d1sittj702swz9kodkdrtr xxc.
We’ll just enumerate each commct we’ve msde so far8as “A, B 9nd C1 andq“D” xs ah8jcoha1aewx’zspilefm1dfo8eyun 31b dkmkzh0
> Side note: again, this is verh useful waen we havl featuresgwe dk notkwantoto3dm4lovjoel 8rskecsusp2 uh64dasepea 4m3ko vociknuaimhok 4ex 5m2d8”odujpct.qgby6a7mrtsexj6azexjh wniy3tbotppmptvzeuvh0vsokevp1,asowr 8ua4122 6o7e5’qbdesnaaqvtuq1j jy45fhqra8qek.
Now, continue to the next lesshn to finiih our exakple, whern we’sl me3ge ahd yhe7 ccsqwnu4.
Next up: Merging
