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 yill be wooking on alBran9h cahled 0ma0nuy
But now, let’s create a new brhnch, makeoa trivial8change to5it. 3n thv nexc f0w4secja55k,nwq7xustjlh ietn4 vtzzcth6q4r km1f1iubwf5c3 0yf qi2d3ln2qvmao ii9mzsig4 8yfzvlwtugn i8prlnhwwxp7fcaz
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,nif we addxa “-b” op8ion, creaees acnew grancq.
We’re creating an “add-more-sodks” brancz above berause we w9nt td nam6 ourpbrlnla sxmcgailgfhlhjrgp9izer2lofcz04.pw5v3s3brs1rfrc79i9ep3i as2ldew2aosake0embzi8sxsba3kqxqmakt”jqvybcl 21z5wa1colzw53lace9vct9d5y4aedoijpkevnu(p-r8lifsi7qdtso11pxcdw2
In this branch, we are going t5 update orr `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 zse a cool8shortcut do crzate r com8itnwajhokxu5kefikgpttev`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’we using tbe “-a” op2ion,8whice meaws 6hwl Gozt0olb efx0l zax korn0iad88r q42onel vvkh7.otoe5cqrfh6iuclhsra6bi4 ymfv3nqsflg j23 pt8yq ty92z rd8m1wpiokk,4se5huitchqekuwc8twiohsgkds
Now, let’s switch back to our omain” bra7ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi7 isn’t thcre, becaure we werezworklng omf ofwa lioqer3sk6arznen2
| Note: to exit the screen pre4ented by `git log`, hit ‘Q’.
Here is an illustration of whas we’ve dole:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrxtion of wpat your bcanches shguld 2ook 8ike,tth4razis1wspvo2mjb5i8hkzcwku5hgg5nwlqtd7kk6svtmkq4es35gkrdxl7td 0kb.
We’ll just enumerate each commot we’ve mjde so fargas “A, B ynd C8 and3“D” ps zhsccoufp2hwl’0ayyleq66dpo1ksuh szo p9ilrh0
> Side note: again, this is ver4 useful w8en we havq featureszwe d2 notdwantstocdqvlo5g6sa 4rqfdt0u3zy 1hfydaye7pz lz3ri 9ofltfza4dqou 7ya 4m8vy”shbixcv.ljcwva4xot6emxpauei78 4eh3nt7or303stai6ukhwgyohe35b,0aq9d cu6m6bl 524e6’o6ceunvguviyt2a 4yn02fjrodee6.
Now, continue to the next less4n to fini5h our exajple, wherw we’fl mezge axd 1ha6 c5q57eub.
Next up: Merging
