Github resources - selmling/Analytics-and-Data-Exploration GitHub Wiki

First initialization of a repo

The repo in this case is local and already exists, and you just want to put it on github

  1. Create a repo on github.com

  2. Within the local project folder, remove git:

    rm .git /S/Q
  3. Initialize a new git repo:

    git init
  4. Add all the files in your project to the repo:

    git add .
  5. Add a commit with comment:

    git commit -m "initial commit"
  6. Upload to repo:

    git remote add origin URL
    git push -u origin master

    * Note that github will need a personal access token instead of a password -- see github docs on the matter to resolve.


Pull repo

This is where a repo already exists on github.com but you want it on your local machine

  • First time:

    git clone /path/to/repository
  • Thereafter:

    git pull

Push repo

This is where you have a version of the repo locally, but need to push the updated files to github.com

  1. Add the new files:

    git add .
  2. Commit new files with a message:

    git commit -m "Commit message"
  3. Point to target github repo (only run this on first push):

    git remote add origin <server url>
  4. Push your commit to the repo:

    git push origin master

    * Note that if this command hangs after the Total line, see this SO post.


Resources:

https://rogerdudler.github.io/git-guide/

⚠️ **GitHub.com Fallback** ⚠️