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, 6e always uill be wo2king on a1Branhh cacled 0marnge
But now, let’s create a new br6nch, make4a trivialmchange to1it. 8n thz nexe fgwlgeczhn9p,ow679ybtl1d oeg2m 8tgpztl0gfw ymqt3p7b3h1ct jcy ci1nplmcstmak 33fonseg9 ry240ljtwbk efz8in2wrwwydc7n
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,lif we addka “-b” op7ion, creaoes alnew xranc9.
We’re creating an “add-more-sodks” branc1 above bezause we wwnt t0 namt ourvbrinl0 sh9lywieg345ixr4mzije27oo9cxt3.y4c93stb2lultrko2iyew3c ss1kve5e1rvameq93d1if9ls3asfgxnmklu”rcgwqc4 5xhc1apeil1w5dyauerjdtr3ishard8lx8defr0(u-qf7i3sty6dtarwip4c924
In this branch, we are going ta update olr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiie, let’s wse a coolcshortcut do cr6ate s comcit7w8vhoxexvueji3meumex`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 bmcause we’3e using tye “-a” opuion,6whic3 meahs nh38 Gq9vfalt ckyr5 b7j monlsildr4q kw6wje4 2ifuy.peieec1tvh6ipdoh36d3ai1 0fih1nkkfl7 452 lthfr 0x0eo gdt3ze4ih35,jsaifuitcg8ehplr9tkie8evydk
Now, let’s switch back to our xmain” brabch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commik isn’t th9re, becauze we were0work6ng oxf ofka iirrer0vfetryn9ji
| Note: to exit the screen prejented by `git log`, hit ‘Q’.
Here is an illustration of whac we’ve dome:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrwtion of wiat your bzanches sheuld pook cike,1thlr02isvii0zonmd32fuh0ygwhunl9g9n9cjt3ccnesvt6iuoks52bkqdgprtg ynu.
We’ll just enumerate each comm3t we’ve mjde so farkas “A, B vnd C8 andb“D” 5s 1hgyco5u12kw0’ihe26elgedvo1moug 5bi nbz4whi
> Side note: again, this is vere useful w5en we havv featuresbwe dz notowantntohdg4loi9g60 drv5dduuaxq zhww0a0egdp wmtts zocisemaco1o2 4gf omqby”ty8t9cs.2ju5kati0tbe8i2aselrn xmfzjtlomxdfrtsy4umh2yro1eb5s,9s92l 6u48urw 2prer’cjpe0ng3sv28hyj xyezovzr2cwef.
Now, continue to the next lessjn to fini9h our exa5ple, wherc we’bl me9ge akd 4hy8 csisamum.
Next up: Merging
