Git

We will use Git as our Version Control System (also known as Source Control). It's like Dropbox for developers. But much better!

What is "version control"? Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

It allows you to revert files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more. Using a VCS also generally means that if you screw things up or lose files, you can easily recover. In addition, you get all this for very little overhead.

Extract from Git Pro book

This answer on StackOverflow by si618 explains very well why we use Version Control.

So what is Git? Git is one of many Version Control Systems available to use, and by far the most popular.

What is Github? Github is a very popular site where you can publish and share your Git repositories, share and collaborate with other people.

Get Started

Follow this tutorial from Github to setup Git https://help.github.com/articles/set-up-git/

Then learn how to use git from the Terminal >

Try completing this tutorial > as well to learn more intermediate features, like branching.

A typical workflow

Using Git through the Terminal

  • git init if it is a new project, i.e. a project not cloned from a repo (or a fork of a repo)
  • git add . to add local files to the index
  • git commit -m "Good explanation of your file changes" to commit files to the local repo
  • git remote add origin GitRepoRemoteUrl if it is a new project (to setup the remote url)
  • git remote -v to verify that the remote url is set correctly
  • git push -u origin master to push your commits to the remote url (Github in our case)

You will also typically need to set up your email and name once when you install Git git config --global user.name <name> and git config --global user.email <email>.

Using Git through a graphical interface

If you don't feel comfortable with the terminal just yet, download the Github client. If possible, however, we recommend becoming comfortable with the Terminal commands and understanding the steps for the different workflows before moving on to visual Git clients.

Github client guides >

Pull Requests

You should also learn how to create and work with Pull Requests.

Github

During our course, we will be using Github to store our code. Github is the most popular Git service around, and is used by many large companies, like Facebook, Airbnb and The Guardian.

CodeYourFuture's Github page >

More Resources

results matching ""

    No results matching ""