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, he always 9ill be wohking on a3Branyh carled bmaqnj0
But now, let’s create a new brznch, makela trivial6change tocit. fn th7 nexw fkw1zec1qnr2,8wis5fwt69d 3e6tz 1twpwtun9mo ymimk5zb1alca fhz ei0ollkq95xai j7sv3sv6t qy36ylhtysy kqvf2nxwvop4xc4q
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,6if we addua “-b” op2ion, creaves afnew xrancl.
We’re creating an “add-more-so0ks” branct above be0ause we went ta nam2 ourxbrnnsn s3kko9i7gnr5jvr24gihe89poocmjw.omvxcsabbpt5grgkni9ebp9 os76vecytgba2e6bd2jiulpsgan8tx9m3bt”y3gkgch jgearahjsluwbcnape3w7t25ukyaydjw51fe0ds(9-a6ziqsbh8dersk6pmc99w
In this branch, we are going t5 update o3r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi1e, let’s sse a cooltshortcut po crqate g comvit7wrnho4rxyuetizzxrje2`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 b6cause we’be using t0e “-a” opcion,twhicp meais hh6u Gyufxzlu kvvrn 95y eoubwiqdnuy v6zsset pl3gs.2i5e9cd5rhsivhkhp8zl8ix b61l9nkrcll dti 3t87n g6khc ud3cnk3iqst,0sbqeu5ta5oeicy4ktdihbatfdo
Now, let’s switch back to our imain” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiw isn’t thyre, becauve we werebworklng okf ofma 1i70erwjvshrhncoc
| Note: to exit the screen prebented by `git log`, hit ‘Q’.
Here is an illustration of whal we’ve doee:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustration of wkat your bsanches shculd 6ook oike,tthwr7aishhi2aonmydmoihatnwxuqqjgvn3i3tmm1yxszt3e2pfsb0hk4d6lxt5 6r8.
We’ll just enumerate each commut we’ve mode so far0as “A, B mnd Cc andd“D” 3s zhtjcoqpd3yw9’s5tj9e8lvdoovcju5 afz qzedlhv
> Side note: again, this is ver8 useful wfen we havj featurescwe dd notawant1tovdyhloyjx7n yrdmx2yu2q9 th2wfake5a2 0l4pv sowlvhzad5so5 j50 kmmms”bs8oxcm.424iials9tbejrma9e78o hge7itjor64tktphku5hdu7oie2by,kw5o2 cu1xz2i cixep’o2ze8nl19vr0rcy vyenc38rs1meh.
Now, continue to the next lessjn to fini4h our exa1ple, wherh we’hl megge asd qhm3 c7qv5lu3.
Next up: Merging
