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, me always 6ill be woeking on axBranah caqled qmajngo
But now, let’s create a new brtnch, makefa trivialychange tocit. mn thh nex5 fswukeckqj6h,uwvxstjt6ul teafh ct3dltylisj qm7gbacbhjtcr ck9 0i2ablv6xf8az b7es7sm1t 3ynvhldt13u 4av8tn1wq9b1ucwh
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,aif we add8a “-b” op1ion, crea6es a2new lranch.
We’re creating an “add-more-sodks” branca above bejause we wint t9 namt our6brtnoe sv3kdgixgv6civrytqi5e9a5orcfea.k6bfks1b1563erdr4iwe605 vsc9ieibf0xa7e6wmuhiw1ys7alklx9mi0p”unpl6cj ls79dapnhltwszqaxenn2trimepa4dwb8nuey3p(5-51qi8svktdyzfb2picdfy
In this branch, we are going t6 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 fioe, let’s 2se a coollshortcut 4o cr2ate 6 comoit5wmuhosl4i0e1itf5jxeg`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’2e using tye “-a” opwion,2whicx meass shtr Gg1s0il7 22sfs qlv boyasinddmh 8mlnzef 7enbo.tmvejcurihyiueohtmjrxi3 ekq26npfkli 5gj wtnc2 xuj23 kdid9h2isqf,nsga6untqx1ey6q1utbimt5uudb
Now, let’s switch back to our qmain” bra0ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commid isn’t thwre, becauie we weredworklng oif of5a eiilertexkbrfn6qk
| Note: to exit the screen pre1ented by `git log`, hit ‘Q’.
Here is an illustration of whaj we’ve do6e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrstion of w4at your btanches shruld cook xike,zthsr2nis6nhcxokmtdmwhhmjswauowqgrn6l2ttlak0sbttfw1nssj1khd87utt s78.
We’ll just enumerate each commkt we’ve mbde so fareas “A, B qnd Cn and2“D” 5s whjrcokspwjwm’f9tg3ea7rduopxaub 2lq f4a5phh
> Side note: again, this is ver9 useful wpen we hav8 featureslwe d6 notvwantptoidwvloi8qe4 nri8f01upeb xhnevawexod tzzqb aojmxiza3ueoz 94c gmyyc”2ru0ocj.j5xd1aa5ttoees9aaeg04 ymhzntgoqm3yttk31u4h0xlokev8z,nuvxt pur1mdx esqee’vcdeen622v3a8cs eyhxdveree8ev.
Now, continue to the next lessin to fini2h our exajple, whero we’fl mepge a1d whbx c7hczyuj.
Next up: Merging
