Skip to content

Instantly share code, notes, and snippets.

@lundgrea
Last active March 25, 2019 15:08
Show Gist options
  • Save lundgrea/97bf058613c194906290a8be8a3f29de to your computer and use it in GitHub Desktop.
Save lundgrea/97bf058613c194906290a8be8a3f29de to your computer and use it in GitHub Desktop.
Beginners_Guide_to_Git_AJL

Beginners Guide to Git

Git

Git is a version control tool, that allows users to take a snapshot in time of their code. This tool gives users the opportunity to roll back changes or to go back to previous snapshots.

The Git workflow steps include:

  1. git init - only used once, initialized INSIDE the folder to track
  2. git status - can be used at any time, shows you the status of your tracking
  3. git add file_name.txt - adds a file to be tracked to staging
  4. git commit -m 'Intitial commit' - takes a snapshot, should be named differently with each commit, start with caps, use imperative present tense
  5. git diff file_name.txt - shows you the changes to the file

GitHub

GitHub is a code repository service that allows many users to work collaboratively on a project. It allows users to work share code between collaborators and computers. Users can pull (download) or push (code) to the platform. Code changes can be recommeneded and accepted or rejected. Code review is another benefit of the platform. Repos can be forked, cloned, or forked and then cloned.

The GitHub workflow steps include:

  1. Fork
  2. Clone
  3. git clone github_url
  4. git push
  5. reload browser

Important reminder

  • No git init is required for forked repositories

Alternatives to GitHub

  1. Mercurial
  2. Subversion (aka SVN)

Companies Who Use GitHub

  • Facebook
  • Amazon
  • Netflix
  • Google
  • AirBNB

Git and GitHub: A Guide for Beginners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment