github basics

to create a git repo:

  1. navigate to project folder
  2. git init

to commit a change:

  1. changes on which files?
    1. specific file: git add index.html
    2. every file that was changed: git add -A
  2. commit changes to repo: git commit -m "added index.html"

to push a repo to github:

    1. create a new repo on github.com
    2. git remote add origin https://github.com/xujenna/project.git
    3. git push origin master

from then on:

  1. make changes to file
  2. git add -A
  3. git commit
  4. git push origin master

 

To run someone else’s project: git clone https://github.com/xujenna/project.git

To get updates from someone else’s project (from within the local repo): git pull

To make a copy of someone else’s repo onto your own github account to push to: clone from existing repo’s github page

To prevent files from uploading to github, create a file called .gitignore with a list of files and folders (ie, file.png, *.txt, images) that you want hidden

  • password = read from config.js; .gitignore config.js
  • gitignore.io for list of files to ignore based on your project

 

Leave a Reply

Your email address will not be published. Required fields are marked *