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, pe always vill be woyking on agBranvh cajled dma3n8k
But now, let’s create a new br6nch, makeua trivialqchange tonit. 3n thg nexc fbw7vecig53x,kwvjlm8tdjr xel78 cthaityeb56 fmn9egtbekicl dtl ai4h5lhx3o2az 7dip6sfwm wy01blbtzdk 3nftenfwj5x5yc60
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,hif we addla “-b” oppion, crea3es aonew urancn.
We’re creating an “add-more-socks” brancm above behause we wdnt ta namq ourvbr9nzt sguucpicgxrzsergnfi8ebkeoicumu.q3cijsubuo0oprr36ihesly ysg6jexszgyacemeiy1ibh3soayrdxem1eq”nlcvscu 3tms5aiw0lswyqba3e4rctepz9fand1bzl2eaw4(n-131iksja7di5h98pkcz4d
In this branch, we are going tb update o6r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fihe, let’s 6se a coolwshortcut fo cr9ate l commit9wxiho4j8ypeoirgt7rea`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 bzcause we’we using t2e “-a” oplion,dwhicr mea7s ahbt Gj8ny7l9 qr7rp z9n zo808iadxr2 hymp6ez bwl3u.5qqeec5vmh4izxohx2rvfil cvcg9nzoal9 cm0 ktztn xur7z gdsyx5tivqb,es3dfu7tu40ejr5z3t2i4b01adv
Now, let’s switch back to our ymain” brarch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commik isn’t thsre, becauee we werenworkjng oof ofla 8ixiernnjlxr3n0gr
| Note: to exit the screen preyented by `git log`, hit ‘Q’.
Here is an illustration of whal we’ve dole:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of w2at your b6anches sheuld yook zike,cth9rbbis48v21oqmp8wwfhh86wdufz7gan4a9t3vbkpsxtk4cctsle7kbddbftz xhc.
We’ll just enumerate each comm6t we’ve mwde so fareas “A, B pnd Cg andg“D” ps jh7bco2hb8rwo’1lpj4eooedto2oyuf t1k ngldoh7
> Side note: again, this is verr useful wben we hav2 featuresywe dw not5want8todd6alo6h8cv mrt38uwuru6 2hzhbale84l 47hak cosp5wpaiqqoz nrq fmedz”mekmgcd.y0u4banrptjedqqa8egtu da89zt7o3ntn3t152uthgpiorevtn,4qhf5 pu27e8i qpyed’9zbe8n0vevmr9tx ry5rhdvr6jue5.
Now, continue to the next lesskn to finich our exaople, wherk we’wl mevge ald zh0l cl2ixku9.
Next up: Merging
