官术网_书友最值得收藏!

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).

主站蜘蛛池模板: 阳高县| 仪陇县| 南安市| 枣阳市| 前郭尔| 潍坊市| 朔州市| 林州市| 攀枝花市| 濉溪县| 同心县| 漠河县| 卫辉市| 文登市| 通辽市| 珠海市| 玉林市| 佛坪县| 北宁市| 宿州市| 肥东县| 增城市| 罗定市| 会宁县| 抚州市| 泰州市| 乐至县| 井陉县| 博兴县| 淮阳县| 建德市| 麻江县| 益阳市| 仪征市| 师宗县| 盐源县| 门头沟区| 贡嘎县| 尚志市| 定边县| 桐柏县|