Skip to content

Instantly share code, notes, and snippets.

@tomatohammado
Last active June 26, 2019 18:02
Show Gist options
  • Save tomatohammado/548c2d6635f5300e02815905d9c0c426 to your computer and use it in GitHub Desktop.
Save tomatohammado/548c2d6635f5300e02815905d9c0c426 to your computer and use it in GitHub Desktop.
SEI31 - Update Global `gitignore` for students that ran installfest before 20 Jun 2019

Update Global gitignore

Purpose

The older global gitignore included files that are only appropriate for certain projects. That caused edge-case issues where students would work on projects outside of the normal lessons but not be able to see the changes to their files.

We have since removed the potentially problematic files from the global gitignore, and very shortly in the course you will become knowledgeable about how to use your own local gitignore file in your projects as you need them!

Instructions

  1. Check the location of you're global gitignore/excludesfile. You can run the following command anywhere in your system (you do not need to be in a specific directory).

    Run:

    git config --list --global
    
    # Example Output:
    push.default=simple
    color.ui=always
    color.branch.current=green reverse
    color.branch.local=green
    color.branch.remote=yellow
    color.status.added=green
    color.status.changed=yellow
    color.status.untracked=red
    core.editor=nano
    core.excludesfile=/Users/<your_username>/.gitignore-global
    user.name=<Your_Name>
    user.email=<Your_Email>
  2. Find the location of your core.excludesfile from the list from Step 1.

    Find:

    push.default=simple
    color.ui=always
    color.branch.current=green reverse
    color.branch.local=green
    color.branch.remote=yellow
    color.status.added=green
    color.status.changed=yellow
    color.status.untracked=red
    core.editor=nano
    + core.excludesfile=/Users/<your_username>/.gitignore-global
    user.name=<Your_Name>
    user.email=<Your_Email>
  3. Use your code editor to open the global gitignore file.

    Run:

    # Do not copy and paste this line from here, use the file location on your system
    subl /Users/<your_username>/.gitignore-global
  4. Open the updated gitignore-global--template from Installfest.

  5. In the tab that opens in , Use the following keyboard shortcuts to update the contents of your local gitignore file

    • CMD + A in the tab from the link to select all of the text from the page.
    • CMD + C to copy the text.
    • CMD + A in the local gitignore file in Sublime Text to select all of the text.
    • CMD + V to paste the text in your local file in Sublime.
    • CMD + S to save your local gitignore file.

That's it! Once you save the file it goes into effect immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment