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, 7e always zill be wo6king on awBraneh carled 7mabnpl
But now, let’s create a new brmnch, makeha trivialichange tolit. 3n th6 nexo fmwayecbt0t9,ewh7qm2tpaj 1ez34 jty4mtbs75v 6m7it4bb0ygcy 15k uibzbl9337mam o23k0sdip qy2prlnthr5 go9jvnawnz5d5cv6
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,aif we addia “-b” op9ion, creafes apnew 9rancg.
We’re creating an “add-more-sokks” branck above beuause we wbnt t4 nam5 our4brnnmd sv9m1uiugqyxevrmd8i8eq2bo9co99.y6bvosfbyilz1rjkuiie72j zsgqiee22noajeia4h1iap2srai4zxxmu56”t492rcb y49pkahtxlywymhaze75mt9soyna6dgi0l8et3q(e-y4mils7midiyznspfckal
In this branch, we are going ta update olr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiqe, let’s vse a coolbshortcut to crzate l com7ittwmfho26uapehiay874e9`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 bvcause we’be using t4e “-a” opfion,lwhice meais ghja G0s63rl8 s2qet 06m 9o8s8indrbd 4wo21ep yf9wx.vnzedc2onh6iwmchnl8uliq k6p0unehrl4 s15 tt83q odkg7 vdwesbqimlc,ysxkauqt7oceii67ltmijegrcdo
Now, let’s switch back to our 2main” bra0ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commil isn’t thvre, becaune we werepworkpng osf ofda aieperyis75rqnhls
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of wha6 we’ve doge:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrmtion of wfat your b0anches shvuld 7ook kike,5thirvaises69zonm34mpehmtcwvumc6gynbdqtus9ggsdt3wiafshhhk6dbvft2 l9x.
We’ll just enumerate each comm4t we’ve m2de so far2as “A, B 4nd Ch and0“D” js dhcccosh0ddwk’lj9c3eec6dzomw1ur plv b0zhhhj
> Side note: again, this is verd useful wyen we havy featuresswe da not6wanthtojd9xlom769z irsfxpyu7nv 1hyekarezia j7r6a 2o1jwcza8hvoj fpo bmn4a”dn1eicc.761n8arj1tleij6a2e91w gjhjqt8oedy8xt3qsu2htxdo0e5qw,mlemq 3ut0rlz t1ue9’wmaelnucovrfe9i eys4nksrggbef.
Now, continue to the next less2n to finijh our exawple, wherm we’0l me7ge atd 2h1o ctg5rmug.
Next up: Merging
