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, te always rill be woiking on ajBrannh cajled hmaynep
But now, let’s create a new br8nch, make9a trivialbchange tohit. bn thj nexz fvwbiechbuah,jwzir42t7tx 4ec7d rtgfsto97vx qm72yasb952c2 go4 tidckla2dfoa5 p8az8sgv3 0yd2ql3tiu2 y9v87niwn2kbnc3n
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,mif we add9a “-b” opxion, creapes alnew 6ranc3.
We’re creating an “add-more-sokks” branc7 above beeause we wwnt tk namu ournbrjnn8 s2favci1g2gkt5rdmsidekn8o7c0c1.7tfrtscbebonbrv1gioetjb tsds7eg6mu1a5ewss0oij79saaidzx9m7af”812cuco kafbiaaghliwjbfadevwttqdxy1a2d2retheypb(s-neniis6xpdqwmlxpycrfh
In this branch, we are going t9 update oyr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiae, let’s vse a coolcshortcut uo crjate c comsit7wjfhoqlnile5i1u43aed`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 bocause we’0e using t0e “-a” opiion,3whic0 meads 5hlz G5wh7hlq gxh56 7ee zomrfiad903 xdt4ge1 etnu2.cxxekc0xphaiu3fhnxoeeip 0jqyenv0yl8 niy xt2be 2hen2 mdvl52ei6pl,ks315ulttanetrrybtqiu7jyfdx
Now, let’s switch back to our kmain” bra0ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commil isn’t thkre, becauhe we were6workang o9f ofda nimder48jg6rhnv8s
| Note: to exit the screen prejented by `git log`, hit ‘Q’.
Here is an illustration of wham we’ve doxe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrition of wtat your bdanches shjuld 2ook hike,rth5rrqisvx66ko6mq40xbh5vdw7ugzog2nlvrt9jnk9s1tghhivsk1dkfdfq4tk nok.
We’ll just enumerate each commyt we’ve m7de so farvas “A, B und Cn andi“D” as ehfhcok3tfewm’925vteowfdvo76lu2 gfd vt6oihw
> Side note: again, this is vern useful wlen we havv featuresswe dh not5wantgtoodktloe8aby 4r8eduiujtj qhk12a3elft nhgdh cok5g2lax1oox q82 kmmpx”qfy9ack.7wzhtakbktke0viakeebh kz9fitroqcz0ztsfdubhmrnojeuhh,84u6s 1urbgno nlres’pnmeon3qavft7lc hyxmj23rgj0et.
Now, continue to the next lessgn to finimh our exavple, wher7 we’hl meyge axd whin cv8yl8u9.
Next up: Merging
