Let’s get started with Git and GitHub through GitKraken

[«PREVIOUS: What is version control] - [Table of Contents] - [NEXT: Cloning and collaborating: contributing changes»]

title picture

We’ll be using GitHub and GitKraken. If you don’t already have a GitHub account, please register for one now at github.com.

Let’s get started on some practical exercises.


Practical exercises

In this section we’ll be:

  1. Creating a new repository locally and on GitHub
  2. Making and versioning changes
  3. Pulling and pushing changes to GitHub


title picture

Source (c) Jessica Lord, BSD-2


Configure your git profile

Before we start, you might need to configure your git profile. You can do this in GitKraken by clinking on the avatar in the top right corner, selecting the profile to edit and clicking on Edit A Profile

title picture

Next complete the details with the username and email you used to sign up to GitHub and save. Git has now been configured with these details.

title picture


Creating your first repository

When a local directory becomes initialised with git, a hidden .git folder is added to it. It’s now called a repository. You can initialise an existing project with git or a start with a completely new project. We’ll start by creating a new repository.





Add a file to the repo

Okay! Now we need to do something with the repository. Let’s start with a basic use-case and make a single file that lists some to-do items. The repository is just a normal folder on your computer where you can create and edit files like normal.






Check out the Git history

Now, if you look at the history of the repository you can see two commits. The first was automatically done by GitKraken when you created the repository - and the second should be yours!

title picture



Make some more changes

title picture

title picture



Pulling from a remote repository

Push makes sure that your work is not only in your computer but “online” as well which means:

Now, what if you you make changes directly on the GitHub repository or using another machine ? These changes are not locally synchronized with your primary computer. This is where pull comes into play.







Git tips

  1. commit early, commit often
  2. commit logical bits of work together
  3. write meaninful messages

[«PREVIOUS: What is version control] - [Table of Contents] - [NEXT: Cloning and collaborating: contributing changes»]