Skip to content

Instantly share code, notes, and snippets.

@brittanydionigi
Last active November 13, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save brittanydionigi/7ffa5c4e1d39aa92b3e95d3358d9d6fd to your computer and use it in GitHub Desktop.
Save brittanydionigi/7ffa5c4e1d39aa92b3e95d3358d9d6fd to your computer and use it in GitHub Desktop.
Tips for Initializing a new repo

These instructions are for whichever group member is going to create the GitHub repo under their account. Other groups members will collaborate after these steps have been completed by one member of the group. You should still step through these together so everyone is aware of what goes into setting up a new repo.

Creating the GitHub Repo

  • Use the GitHub UI to create a new repo, and make sure you initialize it with a README and a .gitignore file. You can select a preset .gitignore file from the dropdown menu. Node is usually a good one to choose. (Feel free to read more about gitignore files here). You can disregard the 'Add license' option.

  • Make sure your repo has a relevant title and description. If you ultimately deploy your application so that it has a URL, you'll want to update your description to include a link to the deployed version.

new-repo


Setting up Locally

  • Clone down your new repo locally and cd into the project directory.

  • Once in your project directory, run npm init and fill out the questions the best you can. If you don't know what to put for one of the questions that appears, simply hit enter. This will give you a package.json file and allow you to install dependencies like eslint, mocha and chai. We will talk more about NPM later this inning, but for now you should install eslint, mocha and chai with:

npm install --save-dev eslint mocha chai

(You might also want to install mocha and eslint globally on your system, if you have not done so yet. This will allow you to run commands like mocha and eslint file-name.js in your terminal. You can do a global installation of these packages by running npm install -g eslint mocha in your terminal)

  • Add the following linting configuration file to the root of your project directory. It should be named exactly .eslintrc - all lowercase, with a dot in front of the name, and no file extension. (Don't worry if you get a warning in your text editor that says dot files are reserved for the filesystem. Just say ok and click out.)

Collaborating as a group member

  • Clone down the GitHub repo your partner has created. Your partner should invite you as a collaborator to the repo they just created, which means there is no need to fork it.

  • cd into the project directory and run npm install

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