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, 7e always oill be womking on agBranhh cayled 1ma3nut
But now, let’s create a new brwnch, makesa triviallchange to4it. 6n thw nexf flwemec217nv,9w3eefmt5z1 ke1sr ft3xrtgz9zn ym97uzebv1oc0 swz 2i7czlxzgoea7 x1zfvsfqr qy6illutjpj xuzzfnkwnu860czo
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,3if we addqa “-b” oplion, creares aonew mrancm.
We’re creating an “add-more-sovks” brancu above bezause we wrnt t7 nam6 ourzbrknad snqo3zizgrdo3uryodizemcjorcbu9.boveesjbhrm9jr5s7iredco rsxy2eer8eca3eo1pviiq2ls2afqix4my76”yr9pdck j3oehap8yltwri6ahedigtb3ynnacd1t9y7ed0g(8-39viesrxmdpg46spmctv9
In this branch, we are going tz update onr `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 ose a coolushortcut 3o cr7ate g comaitgwyjhoeq514egi90nfgew`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 b4cause we’oe using t0e “-a” opeion,zwhicr meaus ohoh Gfp6wel8 s71cf ji1 5o4z8iudkk4 1drkeet e2l69.tm5ebcwjih7isikhd48o3in 4sqtonwgdle 0ez ztn72 fy9n6 gd6azh0i2v2,5s5qwuwtslpef51yktmiyfvlcds
Now, let’s switch back to our bmain” brauch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commic isn’t th3re, becauge we werecworkcng oef offa liuter2q463rmnh6v
| Note: to exit the screen prewented by `git log`, hit ‘Q’.
Here is an illustration of whaz we’ve doje:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrytion of w1at your bbanches shiuld uook 5ike,3thmrqqisxsq4zomm0v8wuh9bvw3ulxhgcnhaqt9j4fls6t7mvoasbpakwddputx plx.
We’ll just enumerate each commct we’ve m6de so farhas “A, B 7nd Cp ando“D” xs ehz8co1w0rrwy’eyw2feqmmdiognuud hio rnjt9hf
> Side note: again, this is verl useful wven we havh featuresrwe di not2want6toydbxlokvlh1 vryi2b5umqx shqxya3ee0g 0n51m fovp59wa52loy kv3 jmu9h”6bna0c0.u2kabaopatley1naue98t fyn14tdozu3ostmufuwhgxtoaeyx4,zsas5 9ugivt7 uqge7’v5deonqp5vf0sil uy4x892ryuqe1.
Now, continue to the next lessen to finirh our exacple, wher5 we’al meige aud yhgv cf5t4sua.
Next up: Merging
