Skip to content

Instantly share code, notes, and snippets.

@emackinnon1
Last active December 4, 2019 21:34
Show Gist options
  • Save emackinnon1/f308ca890e52ca39d8b9c5283bc54ae4 to your computer and use it in GitHub Desktop.
Save emackinnon1/f308ca890e52ca39d8b9c5283bc54ae4 to your computer and use it in GitHub Desktop.
Beginner's Guide to Git

What is Git?

You are not alone in asking this question

alt-text

Git is a version control system that makes it easier to track changes to files. With git, you can figure out:

  1. What changed
  2. Who changed it
  3. Why it changed

A few of the most common git commands that you will encounter:

  • git init
    • Start a repository in your current folder
  • git clone https://github.com/username/repofolder.git
    • Download a .git repository from the internet (in this case GitHub) to your computer and get the latest snapshot of the repo
  • git status
    • View the current status of your project
  • git branch <new-branch-name>
    • Create a new branch name
  • git commit
    • This saves a snapshot of your file in the form of a commit After a commit, you will see something like this in the terminal:
Elliots-MacBook-Pro:etch-a-sketch elliotmackinnon$ git commit -m "start clear function, bugs present"
[master b737a9c] start clear function, bugs present
 1 file changed, 9 insertions(+), 1 deletion(-)  

This is a good rundown of some basics of git, with more to follow!

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