Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>I mean, when git creates a local branch, does it create a copy of the master branch that you can edit? If it does, where are these copies located?</strong></p> <p>Branch is not a copy. A branch in Git is just a "pointer" to the latest commit. The commit object point to their parent(s) and that is how you get the entire "branch".</p> <p>So as soon as you branch from master, you get one more pointer to the same commit. Nothing less, nothing more. Now both master and branch point to the same commit. As you keep committing in the branch now, the branch pointer keeps moving to point to it's branch specific commits.</p> <p><strong>If by any chance I mess up on my local branch, how do I revert back the changes(let's say for example, I want to go back to the way it was when I pulled the master)? Is it just a simple matter of going back to master and deleting the local branch?</strong></p> <p>If you don't like a branch, just delete it - <code>git branch -d hotfix</code> Branches in Git are cheap, as, like I said, it is just a pointer to a commit which means it is a file which contains the 41 character SHA-1 checksum in <code>.git\refs\heads\branchname</code></p> <p>If you do not want to delete the branch, reset to a previous commit using something like <code>git reset --hard HEAD~1</code></p> <p><strong>I suppose that the reason why people call it version control is because of the branches, which I think...Represents the version. Am I correct?</strong></p> <p>We call them version control because of each revisions or commits which is the unit of change. Branch is a collection of changes since a particular commit or branching point.\</p> <p>PS: I am of course paraphrasing ProGit, so since you had commented that you had read it, I am not sure my answer will be of help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload