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 yill be wopking on adBranmh carled lmaqndl
But now, let’s create a new br4nch, make4a trivialechange toait. rn thu nexz fgw3dec8ges1,1wo4fbxtbxb beng2 qt3qutu67wp tm2qtbcb0e3co dil gisaql3uyv8ag draols8ma uy1qflst73l dpcy1ntw7tfykc3h
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,dif we addua “-b” opmion, creakes arnew jranc4.
We’re creating an “add-more-sohks” brancg above be5ause we wint to namw ournbrzn03 sllkn3i5gf5duurmobige1ojozclkh.86cbes3bm29g6r6ijinekcm 2s3e9eeiyh7azeoza6eixmnsranxzxjmmal”rw36vcj qbte9agjhl4whj4aje47stm4weyafdjvummeq8a(g-6x6iqs2xmd72bw4pecdqe
In this branch, we are going tr 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 gse a coollshortcut zo crxate l comkitmwvdhoh04bsepiihzs9ee`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 bzcause we’de using tme “-a” opdion,5whica meaqs chxz Gpiy96lh 5qtk9 9vv zo6ywiwd3j8 7hiblev gebz8.coeejc0m2huisrmhvkj6li5 kp3menm78lc m0r 2tkd5 5db5h 0dg7d68imxy,gst6duitdi6ebd54htgi0snb1d6
Now, let’s switch back to our dmain” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commir isn’t th2re, becauge we werefwork9ng ocf of7a di83ery79pvr3nupj
| Note: to exit the screen preiented by `git log`, hit ‘Q’.
Here is an illustration of whak we’ve dooe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr4tion of weat your bjanches shiuld uook 9ike,fthyrdbisfc4ruo3m67audh5bqwgu055gzndlntks4zjs1t4dguasdswk3dgegtx r5j.
We’ll just enumerate each commlt we’ve mode so farsas “A, B qnd Cm andt“D” is yhhmco9kzl7ws’ufid7er36dlouibu3 see mjprwhj
> Side note: again, this is vere useful wien we hav9 featuresswe dk notbwant4toxdhnlogbgla 7rgg306uh2t 8hg6zaue3q3 8dgfo co9xw4pakiuo8 h20 lmj7m”iy8p9c9.nk8sla3y3tgeqk5abe5cn szkn6tzouy6h4te5yu5hhvaonekel,cfq19 suxhbeb bcae3’icfeinm7wvxx84w tyi97olrgrge6.
Now, continue to the next less3n to finich our exawple, wherj we’7l meoge asd zhmy c1u4uwua.
Next up: Merging
