1.1: Introduction – Git and GitHub for Poets

– Hello and welcome to
Git and GitHub for poets. This is a tutorial series
that I am beginning today and the whole point of
this tutorial series is to explain what is Git, what is GitHub, how do you use them. Let me say something really
important from the outright. You don’t need to know
anything about programming or code whatsoever to
follow this tutorial. Git and GitHub are tools generally used by software developers, creative coders, and eventually as I get
through more and more videos about getting GitHub, we’ll start getting and
looking at code repository but right now, that doesn’t matter. What I want to do is put a poem on GitHub and I want to see what happens
when you take a poem on GitHub and why is that powerful and why would that be something exciting to learn about. I hope that people will watch this who want to use Git and
GitHub for creative ways that might not even necessarily, for collaboration and creativity, that might not necessarily have anything to do with programming. We’re going to start from total scratch. First of all, why do these things exist? I’m going to come over
here to my computer screen and I’ve been working very
hard on a poem about rainbows. It’s a terrible poem. I don’t know if I can show you it. I don’t even want to show it to you. Has this ever happened to you? Did you write a poem and then you made some revisions and
saved it under file_one and then you save another file_two then you called it final but then you wanted to revise it again
so you call it final revise, but then it was really the final? You see the point. Often what happens is
you’re working on something, a poem, an essay, an image,
a design, a piece of code, and you have versions of those over time and you want to save a previous one. The history of what you’re
making is important. This is primarily the first thing about what Git is that is why Git exists, for something called version control. Rather than you, the creator, having to keep track of separate files and history yourself manually, Git is a piece of software
that does that for you. It keeps track of the entire history of things that you’re
working on on the computer. It’s not just for you. This is very powerful on its own, but there’s something more to what Git has and with a lot of features that Git has. What I would say the other
thing that’s really key here, and I don’t know why I’m putting quotes here but, collaboration. To be honest, you can do a lot of
what we’re talking about with things like Dropbox or Google Docs or all sorts of other tools that allow you to keep track
of the history of a file or even have multiple people
work on the same file, but Git is a particularly special tool which has a lot of advanced and sophisticated features for collaboration. In particular, it doesn’t
have a problem with two people working on the
same document at the same time and there’s lots of ways of managing that which I’ll get into as I get
further and further along. This is what I want you to think about. This is system that you can use to keep track of the history of a project as well as allow many people to collaborate on the project together. That’s the first point I want
to make which hopefully is good. Let’s move on here for a second. I need to make a really
important distinction. What is Git and what is GitHub? Let’s write Git over here and
let’s write GitHub over here. This tutorial is going to
live somewhere in the middle. I’m going to kind of start with
just only showing you GitHub, and eventually later I’m going to only show you how to do stuff only with Git. Right now, I want to live
in this strange place that’s in the center. Why? Git is the actual
version control software. This is the actual application. It was invented by that
guy who invested Linux. His name and a link to it will be somewhere in the description. It has another story
about why it has a name, why it’s called Git. You can look that up on Wikipedia. Git is just version control software. There are countless examples historically of other version control software. This is a particularly popular one. You can run this on your laptop, you can run this on anywhere you want. GitHub, I’m going to call it
a web cider, a web service. GitHub is a web service where you can sign up and have an account and do stuff, do Git things,
on a server, on a website. GitHub kind of runs the Git
software behind the scenes. Some people call it social coding. In a way, it’s like a
social network for projects that are managed through Git. The reason why we’re
living in the middle here is I want to show you how to use GitHub to do all the things that Git does, but it should be really
important to realize that these are two
completely different things. Git itself is the application. You could spend you
life being a Git person and never ever go to the GitHub website. Interestingly, you can
also spend all of your time on the GitHub website and never actually run Git anywhere else. I want to live here in the middle. I want you to start by using Git and learning the Git concepts
through the GitHub interface, and later see how those concepts translate locally to your own computer. I said that way too many times, but I’m trying to set
the stage for myself. You can skip ahead to future videos if you felt the rambling too much. Let’s now actually go and get started. Here we are. We are writing a poem about rainbows and this has become a disaster. We’re going to go over
to the GitHub website. The one thing that I’ve done that I’m not doing in this video tutorial is I already signed up
for a GitHub account, a brand new GitHub account. My username is RainbowCoder. You just need a username and an email, you can upload an image,
that sort of thing. Pause this video now and
go sign up for an account or just keep watching,
whatever you want to do. If you haven’t done that and you
want to try to do this along. The first thing that I want to do and I’m going to keep track of kind of a list of terms over here. The first term that’s important, this is a different pen, let’s
try using it, is repository affectionately by me or
also known as a repo. A GitHub repository is
another word for a project. It can have multiple
files associated with it, it’s a repository of files. The first thing I want to do is just make a new repository for my poem. New repository. I’m going to call it Rainbow Poem. I’m calling it Rainbow Poem. Notice by the way, it’s going to name it for
me automatically with a dash because Git repositories can’t
have spaces in their names. This is a repo for my poem. I want this to be public and I also want to check this box right now, initialize this repository with a README. A README is a special kind of file that goes in your repository that says, this repository is a repository
for poems about rainbows. I’m just going to check that ’cause it’s going to make it a little bit
easier for me to work with it. Then I’m going to hit this
green button over here to create that repository. Now you can see, look at this, I have my GitHub repository. This you can see is the README file. It made one by default right over here. This is it. I’ve now made a repository, a place where we can have files. What kind of file do I want to work with? I’m a writer, I’m a poet, a really terrible one, not actually. What I want to do is create a new file. I want to put a new file in my repository. This is the file that
I’m going to work on. I can have many files, but I’m
going to start with just one. I’m going to create new file and I’m going to name my file apoem.txt. There are lots of different file formats that Git and GitHub can keep
track for you, anything, but I’m going to work with
just a plain raw text file. I’m going to scroll down
and now look at this. This is where I name the file. I’m going to write my poem. I’m going to write my poem
down here, The Rainbow. Purple, pink, orange, blue, red, these are the colors of the rainbow. That’s the end of my poem. I wrote my poem and now I’m going to scroll down and you might think,
now I’m going to hit save, but notice here. Look at this. Commit new file. This is another key term
in our list of terms. Repository is the repository of stuff, commit, you can think of this as a save. A commit is I’m going to change
the file and make a commit. I’m committed to this. Very committed to making this tutorial. There’s all sorts of stuff about commit directly to the master
branch or create a new branch. Branching is going to be
the topic of my next video which is going to be exciting
I hope, but right now, all I want to do is press commit new file. I press that. I’m going to zoom back
out and you can see now, here are the files in my repository, the README file and the poem. I’m going to click on poem and we can see, there it is, there’s my
poem, here’s the file. Let’s say I wanted to make
a change to this file. I’ve decided that it’s
missing the color green. This little icon over
here is the edit button. I can use that button to edit this file. I’m going to click edit. You can’t see. I’m doing a terrible job of managing where the stuff is here. I’m going to add right now the line green. I added this, I’m editing my poem, then I’m going to scroll
down and look at this now. Over here under commit
changes, this is the button. All I need to do is press that button and I’ve made a save. However, each commit, each save, can have a note associated with it, which can sometimes be useful when you’re collaborating or even to keep track of things yourself. I’m going to say I am
adding the color green. Then I’m going to just hit commit again and I’m also going to do
this again really quickly and I’m going to add
yellow and I’m going to say adding the color yellow and I’m
going to commit those changes. I’ve made a bunch of commits. Here we can see the
current version of my poem. What have we done so far? We’ve made a GitHub repository, we put a single file into it, and we made a few commits on that file. Why is Git and GitHub
exciting and powerful? Because now I can actually
go and view the history. One thing I can do is I can click. I’m looking for somewhere
in this interface where I see the word history. Right here. I don’t know
why I couldn’t see that. Over here there’s a button called history and I’m going to click on that. Look at this. This is now my GitHub history. The first thing I did was create poem.txt, then I added the color green, and then I added the color yellow. Any one of these that I click on, it can actually show me what
was changed at that moment. You can see the line that
was changed is highlighted, plus meaning something was added. It’s funny, it was green,
it’s also a green color showing you what was added. I can also go back and look and see when I added the color yellow. This is what happened here. There’s all sorts of ways. Something kind of goofy is over here. Look at this crazy number. While this looks like the most nonsensical thing that you would ever want to look at and looks sort of terrifying, this strange crazy string
of numbers and characters. This is the commit hash meaning, a unique identifier for
this particular commit. Notice also up here in the browser’s URL, rainbow-poem/commit/ that crazy number. You don’t ever have to memorize this, you don’t ever have to write it down, but this is something that
I want to point out to you ’cause it’s going to
come up again and again. I’m going to come over here
and look at commit hash. This is a key concept. Let’s review. Git is version control, GitHub is a website where you can do projects that have
version control on them. You can make a repository where you add files to that repository, then you can make changes to
those files by making commits, and those commits allow
you to browse the history and each one of those commits has a unique identifier for it. This really is the basic idea. What I would say now is go and make your own GitHub repository,
write a poem in it, get it going, play around
with the interface, see what happens, and in the next video, I’m going to talk to you
about branches, Git branches. What is a branch and
why might you use them and how do they work on GitHub.

Comments 100

Leave a Reply

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