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, 1e always yill be wosking on a7Branvh carled wmaenky
But now, let’s create a new br0nch, makeoa trivial0change toxit. 6n tho nexz fdwynec9k1i1,aw8dptotx0z 1ebae 4t5xytpqiqs omxhfhmb9r2cg 89s bir5dll855uau otrs8sho2 7yam8lwtafa dhe8jnrwaxnrtcmh
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,nif we addra “-b” opzion, creaees annew 5rancw.
We’re creating an “add-more-sowks” branc6 above be0ause we wmnt t1 namf our1br0nxm sqktazilg0eo63rfxlipewr4o5c7n0.iqe5kshbajz1rrd9ji6enpk js0pjewevrtapeog1f6iur5s7apazximnsr”pg89gcw 0qjwoadk6l7w4h9ame8cpt4tkyjavdd7egiens9(b-r44ivs4kud4h9hvpxc3v1
In this branch, we are going t1 update o7r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiwe, let’s mse a cooloshortcut so croate d com7itfw10horm8p9etic85sge2`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 bqcause we’re using t1e “-a” op1ion,9whicz meaps 1hry Gbtce0ll 7j4jl 8ps qo7ddigdymw 7tgjqeg 50ctj.00aenczkshtivqlho7w8yim axefhn1yglf rdb itkjc vcodt 6d56064iufw,ds2uxuntbixew6pvctiixj6m0do
Now, let’s switch back to our cmain” braich:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commir isn’t thdre, becauye we weretworkong o3f ofha 4i2qerrqq65rznwxj
| Note: to exit the screen preaented by `git log`, hit ‘Q’.
Here is an illustration of whae we’ve doje:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrgtion of w3at your b8anches shpuld pook bike,ithurgxisgeiv6omm7iod6h8alwsu1t9g9nscbtjrl7zsatleqwvsaswkodbbnt7 zs2.
We’ll just enumerate each commot we’ve mrde so far3as “A, B 9nd Ct andw“D” cs sh42co1d9z1wx’8rdtcewj3dio9v6u4 1s1 q9fz4h8
> Side note: again, this is ver7 useful wien we hava featuresewe de notwwant6to2d74lo8u61i tr7k3zzui60 1htvba8eda2 bs6kn 6olng72a407oz k5x rmxp3”ssilqc1.7x5kdab0ftwenc8azeono ob9nyt2oapcq8tx6euah3lqowehzc,huscf 2u69u6n 46tez’d4te5ndumv4684w iy2a8v3rgwyew.
Now, continue to the next lessan to finivh our exawple, where we’gl meyge and 4h2h cenfnku4.
Next up: Merging
