To specify that Git should use the vim editor to let you make your changes you

To specify that git should use the vim editor to let

This preview shows page 506 - 508 out of 517 pages.

To specify that Git should use the vim editor to let you make your changes, you would say git config
Image of page 506
--global core.editor 'vim' . It doesn’t matter what directory you’re in when you do this, since -- global specifies that this option should apply to all your Git operations in all repos. (Most Git configuration variables can also be set on a per-repo basis.) Other useful values for this particular setting are 'mate -w' for the TextMate editor on MacOS, 'edit -w' for TextWrangler on MacOS, and the rather unwieldy ”'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar - nosession -noPlugin” for Windows. In all cases, the various quote marks are necessary to prevent spaces from dividing up the name of the editor into multiple command-line arguments. Unlike MacOS, the Windows shell (command prompt) diverges from Unix conventions, so many Unix tools don’t work properly. We recommend you develop using the Linux-based VM rather than Windows. Screencast A.6.1: Basic Git flow for a single developer In this simple workflow, git init is used to start tracking a project with Git, git add and git commit are used to add and commit two files. One file is then modified, and when git status shows that a tracked file has some changes, git diff is used to preview the changes that would be committed. Finally git commit is used again to commit the new changes, and git diff is used to show the differences between the two committed versions of one of the files, showing that git diff can either compare two commits of a file or compare the current state of a file with some previous commit. It’s important to remember that while git commit permanently records a snapshot of the current repo state that can be reconstructed at any time in the future, it does not create a backup copy of the repo anywhere else, nor make your changes accessible to fellow developers. The next section describes how to use a cloud-based Git hosting service for those purposes. ELABORATION: Add, commit, and the Git index The simplified explanation of Git above omits discussion of the index , a staging area for changes to be committed. git add is used not only to add a new file to the project, but also to stage an existing file’s state for committing. So if Alice modifies existing file foo.rb , she would need to git add foo.rb to cause her changes to be committed on the next git commit . The reason for separating the steps is that git add snapshots the file immediately, so even if the commit occurs later, the version that is committed corresponds to the file’s state at the time of git add . (If you make subsequent changes to the file, you should use git add again to get those changes into the index.) We simplified the discussion by using -a option to git commit , which means “commit all current changes to tracked files, whether or not git add was used to add them.” ( git add is still necessary to add a new file.) A.7 Getting Started With GitHub A variety of cloud-based Git hosting services exist. We recommend and give instructions for GitHub.
Image of page 507
Image of page 508

You've reached the end of your free preview.

Want to read all 517 pages?

  • Spring '19
  • Dr.Marcos

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors