Skip to content

Instantly share code, notes, and snippets.

@sertmer
Last active June 2, 2019 16:14
Show Gist options
  • Save sertmer/012d7d6b3e27d673b227fcc521d850b8 to your computer and use it in GitHub Desktop.
Save sertmer/012d7d6b3e27d673b227fcc521d850b8 to your computer and use it in GitHub Desktop.
Beginner's Guide to Git

Beginner's Guide to Git

Table of Contents

  1. What is Git and What is Git used for?
  2. Is Git the same thing as GitHub?
  3. How do I get started with Git?

1. What is Git, and what is it used for?

  • Git is a VCS - Version Control System. A VCS like Git allows you to manage multiple versions of a file or files, make changes called commits, and keep track of those changes over time. Rather than saving multiple versions of the same file, each with a more convoluted naming structure than the last, you can use git to make those changes, stage them to be finalized, and then commit those changes to the repository when you are certain of them. Git Diagram

2. Is Git the same thing as GitHub?

  • Simply put: No. They are different things. They might have somewhat similar functions, but they focus on different aspects. Git can be thought of as a Local VCS, for managing versions on your single computer while GitHub is more of a Cloud platform with some collaborative functions built it. Think of GitHub as an online repository, so that your team can work on the same files or code, no matter where they are.

3. How do I get started with Git?

  • To initilize Git Tracking, you need to navigate to the directory that you wish to track using the cd command in terminal. for example, you would type

    cd projects/project_1

to navigate to the project_1 directory. Then, to begin tracking with Git, type

git init

Some other Git Commands for Terminal

  • git add <file name>: Stages the file for commit.
  • git commit -m : commits snapshot.
  • git diff : Shows changes that have been made.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment