Create new github repo
-
Go to GitHub.com and create a new repository. Call it what you want to make sure to copy the SSH key after creation. git@github.com:FredLavoie/projectName.git You can choose to create the README.md file. If you do, we will pull it later on at step 10).
-
Create a new directory on your local machine for the project. Initiate the NPM modules and linter if you want to.
-
In Terminal, navigate to the new directory. type in git init which will create the hidden directory �.git� in your local directory.
-
In Terminal, type the following:
git remote add origin <ssh key> -
Create a file called
.gitignoreand add the names of files and/or directories that you do not want to sync with your remote repository. Add the names of the files you want Git to ignore (.DS_Store, package-lock.json, package.json, node_modules, .eslintrc.js, igitignore). -
In Terminal, type the following git add * or choose the specific files you want to add to the first commit.
-
In Terminal, type the following:
git statusto see which files are being added to the commit stage. Make sure that the files you want are being staged, and the files that you don�t want are not present (see .gitignore file). -
In Terminal, type the following:
git commit -m "initial commit"which will create the first commit. -
In Terminal, type the following:
git push origin masterwhich will push your local content to the remote repository. -
In Terminal, type the following:
git pull origin masterwhich will pull the README.md file from the remote repository to your local repository.