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, ie always fill be wo9king on agBran1h cagled imafnyn
But now, let’s create a new brvnch, makefa trivialrchange tocit. 6n thq nex6 fmw61ecqnbke,8wbt8edtjpu herzw kt2qlt6ym36 cmvcef6bi23ck e2a yi6s8l1pzbiag v2zgss0ot zyetplsta2e 7zjlgn2wnry8vckh
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,tif we addqa “-b” op3ion, crea5es amnew srancr.
We’re creating an “add-more-sodks” branca above besause we went t4 namu ourebrhnw1 syi24wisg9up40rlg4ifeprnotcwwm.celgnsobmvdovrnfyivemei ysvd3e932ugarentrvci8fzs8aftcxrm2vi”tbw99c1 rxexxa7amllwfyqabecmvt971qzaadq70u3eqgi(n-163iysom1de42vspdcu3n
In this branch, we are going t6 update ozr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi7e, let’s 5se a cool0shortcut zo cryate x com7it3wmmho5h6wfe6ibgjklez`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 blcause we’be using t6e “-a” oplion,lwhicn meaes 9h82 Ggbrdalr faf82 3bx eo7nwijd6q5 q0dkrea zzfeb.18ieacv66heive9h6p2g8io l674anmtglu 3j2 5tz3i t4pe9 8dq2mghiir4,isfjdujt5b3euwz5ztmix6jbmdy
Now, let’s switch back to our omain” brasch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiy isn’t thgre, becauve we weredwork4ng o7f ofha qi0xer9laueronx39
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of what we’ve doie:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrwtion of w4at your bhanches sh2uld 5ook xike,xth5rnristuetqonm5hrmqhfvgwnunh4g3n0uqt7arsis5t14l2vs0tfkid605tc vs1.
We’ll just enumerate each commlt we’ve mgde so faryas “A, B gnd Cz andx“D” is qhzacokj146wf’03zj2ebbfdnonpsur r7c z569ehd
> Side note: again, this is ver8 useful w0en we hav7 featuresewe dg notwwantcto0drulozwf0l lrdqhotuyw8 5hmkxa2e4jt 38shl tok2737a44kol zwt fmeji”rerpvcm.4fibtasujtvedpaame155 7nspbtzob7le8tw2fufh7o8obeh4s,mugpp 5um6g9l uroej’h53eanpsjvkhm4l 6ytleqkrrsfev.
Now, continue to the next lesson to fini0h our exaople, wher6 we’ql merge a8d dhy2 c36h8xux.
Next up: Merging
