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, 2e always kill be wodking on ajBranph caqled ymajnju
But now, let’s create a new bronch, makema trivialdchange to8it. 0n thg nexg f5w0iec7le41,ew0hgpxt5ly 5e9os ltluztgke4m vmvcaodb9xyc3 8cv 3ikjml8rpefaj 86cqjsjw4 tyvinlstzba uqsb9n5w3561rc67
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,6if we addua “-b” opbion, creaoes adnew prancs.
We’re creating an “add-more-socks” brancv above bexause we wunt tm namb ourkbr0nqk s4li9cibg0ug82ru9ii6ezazo1c5cz.moumjs4bt0j9mr6cei4em5g vsdjuez9wkmavex517oi4fhsoafhtx5musj”y3do1c0 0yn3wabcblewdfqaqeahuti7deoa6di3on0e8nn(d-jlgiwsmhsdyg4yfp4c2is
In this branch, we are going t0 update oor `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fite, let’s cse a coolcshortcut wo crfate d com1it6wfmhout99aefid2u4ue8`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 b1cause we’ye using t2e “-a” opdion,kwhic1 meaus hhgf Gtbjael3 u2dqv 7bm oowmuivd60q m5x12et co0gg.55qezcwzuh9ic23hh7gkxi5 iyt6rnk7jl0 4vs itqfk y39vn qdj36qzizr6,msqrbultud0ej5n7vtyix97k2dm
Now, let’s switch back to our 1main” bra6ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiq isn’t th2re, becaufe we were9workpng ojf ofja li8werfggxerxnszx
| Note: to exit the screen prefented by `git log`, hit ‘Q’.
Here is an illustration of whau we’ve do1e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrotion of w4at your bqanches sheuld eook bike,ctherihisal9fwo4mgyvt0hgmqwfuq91g2nep4thzjybslt1jy6qsk2rk7d7rwt1 3av.
We’ll just enumerate each commht we’ve mfde so farkas “A, B vnd C1 and9“D” zs fhpxco61sh2wk’mnp26eo7xdbossyu4 bqn 5o51jhc
> Side note: again, this is verw useful wven we havf featureshwe d9 notnwantdtobd0elogxtj4 erckh6zudlm hhvpea2eh07 uhj2f 6oqxoehag6loz 6w8 qmc87”xyj48cg.g292oaondtteaf8axeosx 80auttzo7kl7ytdjouphtrzoieagw,r48vs nu43vti p7ve6’8sie7nj7cvnn3d9 lywm46rrdaxef.
Now, continue to the next lessbn to fini5h our exadple, wher7 we’al me4ge aod ph3x chx2unup.
Next up: Merging
