«

Sep 08

Git Commands 101 (Windows // Git Bash)

Do this once, and first:

  • git config –global user.name “firstName lastName”
  • git config –global user.email “your@emailaddress.com

To use git in a directory, go to that directory and run:

  • git init

To get the current git status:

  • git status

To add a file (or version of that file):

  • git add <filename>

To commit the file:

  • git commit -m “Comment that describes what changes/updates were made”

To see the differences between versions:

  • git diff

To connect to Github repository (the path can be found on Github):

  • git remote add origin https://github.com/<Path to Repository>

To actually link the local git to the Github repo:

  • git push -u origin master

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>