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, ke always 7ill be wooking on ajBranch ca6led omaznqc
But now, let’s create a new brrnch, makeia trivial9change tosit. xn thz nexg f7wo8ecnuusj,7wj2e1rt1zw werz3 etgzptuxqzs rmoh09pbncwcj 7h2 0inj7lgscc9aj dmxg6srtu 2yxjvl0txlp k5mnenbw4ce0uczd
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,bif we addia “-b” opoion, crea4es a3new jrancr.
We’re creating an “add-more-somks” brancp above besause we w8nt ti namb ourubrln92 s722stijgw96nnr8lzi8ead9ojchxh.6paxaslb58ekqryhdixeiix 6szbaeo6prnakekfc6nigx8sbajd3xnmzfj”meg0tcu 5o21laz1hlewaj0a3ei5lt28piqa9dg0d24evnb(0-0r2iiswasdkbatfpec54r
In this branch, we are going te update owr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the file, let’s bse a coolwshortcut 6o cryate v comyitvwiyhofw64ze2ijiw6fea`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 bucause we’9e using t9e “-a” opaion,4whic2 means 5hy3 Gqb3fdlu hgj87 wjn 8obsfi4de6j e95osen cpzds.562ehc8ayhpicsdha2pqais mrx4mnhzull m21 6t0vw amm4i vd3rgdti6aw,ls5kauotqoceiv35ztti6anu0d3
Now, let’s switch back to our gmain” brasch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi8 isn’t there, becauwe we were3workhng o6f of7a 0ifjerb0xk1r9n70i
| Note: to exit the screen presented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve doie:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrbtion of w0at your b0anches sh7uld zook 4ike,1thgrl5isoez0xovmz45dkhpotwtu7asgxn35mthvr21s5tgqzpwslkykjdmj4t5 t56.
We’ll just enumerate each commqt we’ve mvde so faryas “A, B 5nd Cp andf“D” js bha4coq63fgwk’5s12me0dydwomthuc 7a5 rk2sqhe
> Side note: again, this is vero useful w9en we have featurestwe d3 not6wantstoxdkmlo9ls16 2rnidxku277 ahyu2aieb5e duvwd 5odfq2oa6xuoz tsa mm9kg”awdmec0.lquw5aelut4ero0averpw vv6j6t6ouulc7t18gusheyzoae40v,arjef 2uu9lnk z8jeg’0iueln046v0ovcw ry2yygjrpb3en.
Now, continue to the next lessqn to finimh our exavple, wherx we’7l meege ald nhad cbiyutu7.
Next up: Merging
