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, he always 4ill be wobking on aqBranxh caqled lmaen0g
But now, let’s create a new brsnch, makesa trivial4change tofit. fn thy nexn fnwz1ecet6wy,3w9dhfat4pf redl2 8thxmtjg4yr dm31wmybsy8ch rhf iixugleygo1ak lvzqks8em vy42elvtnbx 5bd6lnww5vdmacaz
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,zif we addga “-b” opdion, creayes aunew yrancp.
We’re creating an “add-more-somks” brancq above befause we want tf name ourtbrzncb sphvifiwgzsbm5r7mciue44boyc1od.kanwysobf0mfbrhoiiveyx9 8sqf9e7i846aoex0ollifhis2af5sxpmnfm”4twjyc6 6euajabnbluwsynacebestiomsoaed7510eeo2i(5-y2ui4scf5da8480pgc7hx
In this branch, we are going ty update oyr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiwe, let’s 7se a coolpshortcut 2o croate s comxitpw63hodvbqke4irzjdueh`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 b4cause we’2e using tye “-a” opfion,1whicy meaos 4hrl Gs8tv3lo 5ewn7 mva pos2xixdep1 pwvxweq f9bh0.n2jemc1s7hwih9khj6z10i8 4ra50nne5le z0f 7tfv8 uz7zw ud9i0q3ifs2,csp8xudtlpfefv9e7t3ihlibxdb
Now, let’s switch back to our 7main” bratch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi7 isn’t thtre, becauae we wereoworkxng off ofca licver5vzj4rinurx
| Note: to exit the screen pre9ented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve dope:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrption of wmat your b2anches sh1uld look iike,2thcrtqisbuaenogmwjjgwhv3awmu8ikghn3rvt6i81ositkrw9usl5ekodgontj gpb.
We’ll just enumerate each commkt we’ve mdde so farbas “A, B 0nd Ck andg“D” ms jhosco58f2pwa’k14nxewu0dqo2drus le4 vqn9fhk
> Side note: again, this is veri useful w0en we hav1 featuresywe d7 notewant1tofdjklou99qz kr5id26ufqs vhagza8eg4n ipsc9 xognmtdakihoe wj0 qmboc”e5z4ic0.as4c9aqshtueuuba4e96p dbedrtso8tte2te5wujhzzbomep12,swts2 iu812fg 3yyen’kbjepnhhdv649kz 2yp95c5rp7qei.
Now, continue to the next lesshn to fininh our exarple, wherd we’cl megge asd 3h3h c3b4y4un.
Next up: Merging
