CBlog(handziuk)

Bradley Handziuk's blog

Adding code for the first time to GitHub through git

The git documentation seems really good so far but it is a little verbose. Here's a fast bullet list to get you going immediate. It assumes that you have a GitHub account and you made a repo through the website.

  1. Open git bash
  2. cd to the directory where you want to put your repo. (mkdir if you need to)
  3. git clone <your repo url on GitHub>
  4. add all your files/do work 
  5. git add .
  6. git commit - commits all your changes
    1. This will open up a vim editor. Add whatever comment you want for this commit.
    2. Press Esc to get out of Insert Mode (press a to get back into edit mode)
    3. :w to save your comment
    4. :q to exit the vim editor
  7. git push- pushes that commit up to the repo

Another good to know

Revert changes git checkout -- .


Loading