mirrorvorti.blogg.se

Git checkout branch
Git checkout branch












git checkout branch

Looking at the Log, you'll see that your new commit was properly saved.

git checkout branch

Let's prove this by creating a new file called "contact.html" and committing it: $ git add contact.html $ git commit -m "Add new contact form page" $ git logĬommit 56eddd14cf034f4bcb8dc9cbf847b33309fa5180Ĭommit 2dfe283e6c81ca48d6edc1574b1f2d4d84ae7f1Ĭommit 2b504bee4083a20e0ef1e037eea0bd913a4d56b6 From now on, all of our changes and commits will only impact this very context - until we switch it again by using the "checkout" command to make a different branch active. Running "git status" once more, you'll see that we're now "On branch contact-form". (b) It replaces the files in your working directory to match exactly the revision that "contact-form" is at.(a) It makes "contact-form" the current HEAD branch.To make another branch (say, "contact-form") active, the "git checkout" command is used.

git checkout branch

All other branches (and their associated files) are safely stored in Git's database. The files in your working copy are those that are associated with this exact branch. And since a commit references a certain version of your project, Git always knows exactly which files belong to that branch.Īt each point in time, only one branch can be HEAD / checked out / active. Concept Checkout, HEAD, and Your Working CopyĪ branch automatically points to the latest commit in that context.














Git checkout branch