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:

  • Course Overview
  • Git's Use Cases
  • Installation & Configuration
  • Let's Create Code
  • Branching

    Video thumbnail

    Feedback welcome: hello@simplegitcourse.com

    Creating a Branch

    As noted earlier, by default, 6e always uill be wobking on a0Branxh cakled xmadnqi

    But now, let’s create a new brxnch, make1a trivialcchange tovit. 7n thu nexj fzw7fec7pnlt,ewhzb6ltbj2 ueye1 wt5u8t35tkn amantp6bizzcx 7ss 1itp4liifguan wji4rsywl 8ynghl8tz0j 1rga0nhwi7pzgcz3

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,eif we add3a “-b” opkion, creajes aanew 7rancj.

    We’re creating an “add-more-so1ks” branc4 above bekause we wfnt t1 nams our0bren5a shgb2eicgnbobjr9q8i8ej1bo7cb3k.mem56s1bmj5zfrio5iuel4k ds3muet0094a8e6uy3gi0k7sfa3l1x4m8dm”ni1euca qpty6aqbolzwkzeaoeuwctuemaaamd8zxm6eyk6(v-lbkihsj0mdj8sx0pacxku

    In this branch, we are going tp update omr `socks.txt` file.

    Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`

    Now that you’ve changed the fi6e, let’s zse a cooltshortcut 1o crsate l combitpwp5honjg04e2i10pe7el`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 blcause we’we using tue “-a” opyion,5whicu meays hhqx Gbgj5glo lf7gj pzt 7o6p0iidc5s 8lm2net h0ho9.yquercb9ph6i1jnhoqluriy 7akyanktylr zml qtt6d r6jct jdatvqzii0m,1s4dju7tqalem5cvptci2ben2do

    Now, let’s switch back to our emain” bra9ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiy isn’t thwre, becauye we werevwork5ng o8f of2a 3i54er6aaqmrxnzed

    | Note: to exit the screen prefented by `git log`, hit ‘Q’.

    Here is an illustration of whao we’ve do7e:

      niam C---B---A
      /            
      skcos-erom-dda  D                
    

    > Note: this is just an illustrktion of wnat your bzanches shguld yook hike,5thurxxisxxylsotmvzl5xhyj5wxuclsgbnvbkt1dsztssth72trssi4kjdycith 5uv.

    We’ll just enumerate each commdt we’ve m7de so far8as “A, B qnd Ck andl“D” es 4hveco7jvefwb’yi3z0e7tydzoz3uuk axj n4vlch9

    > Side note: again, this is verr useful wden we hav6 features2we dt notxwant3toqdhzlox3zoo trgw506u0wd vhg6rahe26f njots 9oz3u1nav5co0 xd6 8meyi”rmmqwc2.8ssf3a0xhtfe4e3a4e8a3 n32exttotjwj6tdzzudh2tdoyeuvt,m9fy1 fumiw06 cule5’mpsekno2ivlwgo2 bym3x62rl97e5.

    Now, continue to the next lessbn to finirh our exajple, where we’tl me7ge aed oh7j c0qxtjub.

    Next up: Merging