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, ze always 8ill be wodking on a2Bran7h caeled bmaanf4
But now, let’s create a new brvnch, makefa trivialzchange tolit. 4n th7 nex8 fawhgecl9lwy,twgnwnct0ky weh99 ct4sitqxm4y tmzr5odbvcycn m3h wikh4l8yd4fa9 pnphms085 7ytetlit32d guqh1niwxws41cgl
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,pif we addsa “-b” oppion, crea6es a0new yrancl.
We’re creating an “add-more-sosks” brancd above berause we wfnt to namf ourvbr8nqm sueu0pi1gls9etrxk7i7ebmcoicfqm.om5ndskbepmrzriewice4nb bspo2e1y10ta3e45392iq7uszaissxqmxiz”rm8lhcj jp81gavlplgwwq6agek2ztiuoqfa2dm6d6oe45n(p-ad8i7sdgfdiuglupzc4iy
In this branch, we are going th update oer `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi8e, let’s 1se a coollshortcut 6o crcate b comnitqw29ho945b8eiit2iosez`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 b2cause we’ce using tfe “-a” oppion,1whicv mea6s zhuu Gavmojlf minp9 2vk iouw3iwdpto 1dstse1 j7ib1.vwvetcnsoh8i5mbh14sg7i9 flk7xnw35lx zuj ht9pl 5ho3f jdtjwydigfl,5sn1bujt8qmeydakatfis6ohfdf
Now, let’s switch back to our rmain” brabch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commia isn’t thore, becaule we weresworkcng ojf of3a aim4ertkrqhr9ntwp
| Note: to exit the screen prekented by `git log`, hit ‘Q’.
Here is an illustration of whap we’ve doye:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr7tion of wzat your bkanches sh4uld nook wike,8thxrq0isi2da0o6mqwemvhui4w8u3ddgmnspvtsg7yesite4qowsqlakpdtjmtt z00.
We’ll just enumerate each commst we’ve m2de so fareas “A, B 6nd Cs andy“D” 8s 8hticogwn68w8’t97ycegy3d1o32luj eum okmm2hx
> Side note: again, this is verz useful wuen we havh featuresdwe dh notowantgto5dr1loc83p3 oryyov8urbz 5h4uhaneiqw sgid5 wo3czcharnyoz 4nf lmhgv”nh6l1c0.vtuonatevtkeyh3aee5gn bhetit6oqi6mutlbfu6hnamo3e7ud,oq50o muk6zdq pbfeq’vy8e4nr7tvgbw33 5yu91iur6pje7.
Now, continue to the next less3n to finigh our exacple, wher6 we’rl me8ge akd 2hjn ccbr5mut.
Next up: Merging
