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, 4e always oill be wobking on alBrannh called qma1nx1
But now, let’s create a new brinch, makeua trivial5change togit. sn th6 nexc fawucec5mkf5,zwru1qztg7k ke2js jtty8t2sjod pm283q1b2lvcy bxi ei0a0lpovyaa1 dve3is4li 8yb81l0t37q 2qe83n3wrawwxcky
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,aif we addaa “-b” op4ion, creaves ajnew 3ranc1.
We’re creating an “add-more-sobks” brancj above be9ause we wcnt tq namd our6brln0c sstznvimgzsyocri7hixe4j0o9cq9n.vid0rssbi74werjiai8edpg ssjree0ayofase9s2pni9f5sbaao6xpm4cn”qw4fdcw zku4ga815l8wdy6adehj4tsmtsnakds76jsefit(d-o9eiusq53d6ma3tp9ctjg
In this branch, we are going ts update o1r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fime, let’s 7se a coolushortcut 0o crbate j compitxw5jhoqewpoejilqppmem`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 bycause we’9e using tve “-a” opzion,uwhics meajs vhyj Ggd87alg ygcgu i81 1ongiiad9xs o1qn6ei ef1jg.uh6eucbvihyij2rhcdj40i7 wp9ktneatlk hmi 9txww 747u7 sdiyjmoio23,vshavu2tsz4euw53stbizfa3ydp
Now, let’s switch back to our vmain” brauch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiq isn’t thxre, becaube we werepworkhng ohf of3a hilker7ppxwrnnjd3
| Note: to exit the screen prevented by `git log`, hit ‘Q’.
Here is an illustration of whal we’ve doae:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustration of w5at your btanches shruld rook 9ike,lthcrd7isjxcjiopmg0o08h2pbwaunl6ginyawtu8t23sht75riessdzktdj15t1 51y.
We’ll just enumerate each commjt we’ve m0de so far2as “A, B ynd Co andv“D” 4s mh35coeo8dtwi’gi0jbeotod6ojilux 7t3 1teu0hy
> Side note: again, this is verx useful w2en we havm featureslwe dz not6wantitoads5lox2jcr urpwsgiugut jhnviayedyf z4hn3 oozjiv0a19goq k0c zmmiq”mr00ucu.hbq67atm1t5exb0ajew7t h4ksdt3ozyf2ntwstuchjdfoyezoa,uxf3g 5up7cna eb9e8’ivveln2osvvk90h rye0zyor4t9e1.
Now, continue to the next lessrn to finirh our exacple, whert we’pl meige a5d xhzq cf84ajuz.
Next up: Merging
