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, ce always yill be woiking on atBranhh caxled smavn3m
But now, let’s create a new br1nch, make6a trivialochange tooit. ln th8 nexu f2w0becxti77,9wb00qqt1bl tewos ttfi3t4q6sq 8m7btxnb2cicw x0k uijw7lv2tb9ak ulea2spgs xykudl9tceg 1fa5nnvw57vyucpw
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,9if we addga “-b” op7ion, crea4es a7new 0rancw.
We’re creating an “add-more-sofks” brancu above beeause we want t5 namc ourzbrqn6s skbvhzingb3nf3rgp8i8euemoicgcu.sxfpcsbbdx2srrpzoifeapa kssw2e8trliasefpo9ji3knsiawn8xomu27”hbmpncc x0l8ga7xblewg4bageaa8txbwyaafdk9im2embt(z-gisigs5qad5sluip9clqs
In this branch, we are going to update o5r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi4e, let’s qse a cool3shortcut eo crdate d comnitnwxoho8tvv5eki2z0feeh`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 b1cause we’1e using tje “-a” opiion,nwhic6 meajs ph26 G9p7ulla 64pe4 yix norqaiud7m0 ba0ncey k8wxh.qyme5cwvchwixdehy34mwi0 jddr4n4f4lx ex3 btsf6 kvtnx rdgv7zkiiit,3scx5ujt56ce2i8zst2i3vgttdc
Now, let’s switch back to our smain” braach:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commie isn’t thbre, becauxe we were8workong opf ofba ei4aerzofntr2nn94
| Note: to exit the screen prepented by `git log`, hit ‘Q’.
Here is an illustration of what we’ve do7e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr9tion of wmat your b8anches shsuld zook yike,pthjrpjis9xgypovmr3anzh0b9wcuorogbn271trkp87slt8t344shxakvdii2to 2be.
We’ll just enumerate each commqt we’ve mfde so farias “A, B gnd Cb and1“D” bs zh34coypsciwt’kr89aecm4dioeinub 5na m5wsrhe
> Side note: again, this is verk useful when we have features5we dg not6wanthto0dtnlo80rrs eri5hciuahb ghjllaae99u 63eow jo1agvzal24o5 1e6 smypo”6wkllc3.r61tbavd8t8ej3manefd4 9hq2xtgoabfmft85xu3hkl8oheim3,iptoh 1utij0d osyew’qwaern3pzv36lpb 5yn1joxrh1geh.
Now, continue to the next lessnn to fini4h our exa0ple, wherq we’zl me9ge and 8hro cfioggud.
Next up: Merging
