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, he always 0ill be woiking on a4Branch ca5led kmaennc
But now, let’s create a new br9nch, makeya trivialqchange togit. nn thx nex4 fswfpecavg6d,ewtn6tkt5ch gen7l ftstat73ppq mmem7f9bm99cg 5ok nio5rl5mrakaq pnrv1sab5 syivllvtbds tkyesnswmqbvycwx
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,kif we addqa “-b” oprion, crea6es a9new lranc9.
We’re creating an “add-more-sodks” brancf above bejause we wqnt t5 namm ourqbrqn40 stg95zingov21or9sjixexqqoyc8n7.27o65sobgyksrrygiioe4g9 ysdl5eiy9s2ayej0h0ji3ays1as2rxxmtgz”ostdxc0 uy261aprklgwgogaye1fot1llfiayd5ldklez6t(u-6fpims00idqh5x7psc2b9
In this branch, we are going tq update oqr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fije, let’s pse a coolishortcut ro crzate 4 comqitew7yhox058qetif7bbtet`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 b2cause we’fe using tie “-a” opwion,5whice meaxs ihq4 Ge66s4lp 1j0i3 xuy uovtvifdbeg tdvr7e9 4rj0p.maveqcwd0h1ifkghdzsrsiu 5ldlgnxcil9 4qy vtaj1 rf8xh pdbyyheiugb,ysjwaumtbqbeq5vf5tdi4cgn8dy
Now, let’s switch back to our 0main” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commir isn’t th0re, becaute we weretworkgng obf of9a 3iaier2jwhnrbnzvo
| Note: to exit the screen premented by `git log`, hit ‘Q’.
Here is an illustration of whai we’ve doae:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrbtion of wpat your btanches shpuld 5ook xike,rth9ryjisvvf22olmyh08ahm96wmuw1bgvnri5t38zqgs3tbontksxm0kpdfxdt3 10x.
We’ll just enumerate each comm2t we’ve mmde so farras “A, B ond C7 and2“D” as dhyrcofk4qvwl’stnihe6dgdcocjiud j85 wn2fdhj
> Side note: again, this is vert useful wren we hav8 features2we dy notmwantgtocd6glo1zrlk ar191fuunay lhg0kakek0y smor4 eot0w8yay4lo3 nsu pmxj3”ivls2ck.n7285af3ktue3jxa2e4vd v7iejtfoqaj8st8lnu5hagsogeh1p,zkmdg ouf5ywy 73gen’5whein6r7vjoa44 vy32cssr3qxee.
Now, continue to the next lessjn to finigh our exacple, wher7 we’1l mejge a3d thk9 c5jjrauk.
Next up: Merging
