my question innocent. i've been reading on git, , know basics pushing , pulling , creating branches , on. mentor told me proper way work git pull resources, create new local branch, transfer , edit local branch , once you're done, go master branch , merge local branch. question is, happens behind scene?
i mean, when git creates local branch, create copy of master branch can edit? if does, these copies located?
if chance mess on local branch, how revert changes(let's example, want go way when pulled master)? simple matter of going master , deleting local branch?
i suppose reason why people call version control because of branches, think...represents version. correct?
why master called branch? shouldn't trunk? okay dumb question, ignore #4... hahaha!
answers innocent childlike questions shall appreciated. <3 <3 <3
i mean, when git creates local branch, create copy of master branch can edit? if does, these copies located?
branch not copy. branch in git "pointer" latest commit. commit object point parent(s) , how entire "branch".
so branch master, 1 more pointer same commit. nothing less, nothing more. both master , branch point same commit. keep committing in branch now, branch pointer keeps moving point it's branch specific commits.
if chance mess on local branch, how revert changes(let's example, want go way when pulled master)? simple matter of going master , deleting local branch?
if don't branch, delete - git branch -d hotfix branches in git cheap, as, said, pointer commit means file contains 41 character sha-1 checksum in .git\refs\heads\branchname
if not want delete branch, reset previous commit using git reset --hard head~1
i suppose reason why people call version control because of branches, think...represents version. correct?
we call them version control because of each revisions or commits unit of change. branch collection of changes since particular commit or branching point.\
ps: of course paraphrasing progit, since had commented had read it, not sure answer of help.
Comments
Post a Comment