Just get on Github!

“Just get on github!” If you’re an up and coming programmer in this day and age, I’m sure you’ve heard this before. So you went to github, got an account, and then thought “now what?”

Maybe you typed git at the command prompt, and got some error about it not being installed. Maybe you even did step 1 below. Maybe you’ve now turned to google, and it was less than helpful. Or hopefully it brought you here and you find this slightly more than helpful. Either way, the first thing you need to do is install git.

If you’re using Ubuntu, or some other Debian based distro, that should be a simple apt-get:

sudo apt-get install git

It will want to install some extra stuff; let it. When it’s done you’re ready to get started. First, you need to tell it who you are:

git config --global user.email "[EMAIL_ADDRESS]" git config --global user.name "[NAME]"

This e-mail address and username will be used with your commits. You should use the same e-mail and username that your github account uses.

Next you need a repository. If you have one already, you can skip this step. Otherwise, login to your github account, and click New Repository.

Give your repository a name and a description. Check “Initialize this repository with a README”, and select a license. Click Create repository.

You should now be sitting at the page for your newly created repository. On the bottom right hand corner of the page, there should be a text field labeled “HTTPS clone URL”. Copy the provided URL, you’ll need that for the next step.

At your command prompt, cd to the directory where you want your repository located. Once there enter:

git clone [HTTPS CLONE URL FROM ABOVE]

You should now have a local copy of your repository. You should cd into your repository folder; for all operations below, you need to be sitting in this folder.

To add things to it, copy it into the repository folder and enter:

git add [THING_TO_ADD]

To commit changes to something you’ve added:

git commit -m "[COMMIT_MESSAGE]"

When you’re ready to push your changes back to github:

git push

You will be prompted for your github username and password.

At this point, you can login to your github page, and your repository should reflect any changes you made.

…And just like that, you’re on Github. Now, get to work!

Trackbacks / Pingbacks

  1. Into The (Local) Cloud! | Doing My Programming... - January 14, 2016

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: