Project management on GitHub – getting your Source Control

A very important thing to do for your project as you're developing it is to generate a timeline history as you're working. To do so, you need to back up your source code periodically. A great tool for doing so is Git. Git allows you to park changes (commits) into a repository online on a remote server so that your code's development history is documented and preserved on that remote server. If your local copy gets damaged somehow, you can always recover from the online backups. This timeline-history of your codebase's development is called Source Control.

Getting ready

There are a couple of free services that offer online source backups. Some of the free alternatives for storing your data include:

  • Visualstudio.com: limited/private sharing of your repository
  • github.com: unlimited public sharing of your repositories

Visualstudio.com is great for when you want some privacy for your project for free, while GitHub is great when you want to share your project with lots of users for free. Visualstudio.com also offers some very good workboarding and planning features, which we will use later in this text (GitHub also offers a competing Issue Tracker, which we'll discuss later on as well).

The website you choose depends mostly on how you plan on sharing your code. In this text, we will use GitHub for source code storage, since we need to share our code with a large number of users (you!)

How to do it...

  1. Sign up for a GitHub account at https://github.com. Sign into your GitHub account using the Team Explorer menu (View | Team Explorer).
  2. Once you have the Team Explorer open, you can sign into your GitHub account using the button that appears in the Team Explorer window.
  3. After you've signed in, you should gain the capability to Clone and Create repositories. These options will appear right underneath the GitHub menu in the Team Explorer.
  4. From here, we want to create our first repository. Hit the Create button, and name your repository in the window that comes up.

    Tip

    When creating your project, take care to select the VisualStudio option from the .gitignore options menu. This will cause Git to ignore the Visual Studio-specific files that you don't want included in your repository, such as the Build and Release directories.

  5. Now you have a repository! The repository is initialized on GitHub. We just have to put some code into it.
  6. Open up the Epic Games Launcher, and create a project to put into the repository.
  7. Open the C++ project in Visual Studio 2015, and right-click on Solution. Select Add Solution to Source Control from the context menu that appears. The dialog that appears will ask whether you want to use Git or TFVC.

    Tip

    If you use Git for your source control, then you can host on either github.com or Visualstudio.com.

  8. After you add Git Source Control to the project, take a look at Team Explorer again. From that window, you should enter a brief message, then click on the Commit button.

How it works...

Git repositories are important for backing up copies of your code and project files as your project evolves. There are many commands within Git to browse the project history (try the Git GUI tool), see what changes you've made since the last commit (git diff), or move backward and forward through the Git history (git checkout commit-hash-id).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.88.7