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

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

主站蜘蛛池模板: 淄博市| 遵化市| 田林县| 郯城县| 三江| 潜山县| 务川| 威远县| 福州市| 海淀区| 余江县| 华宁县| 洛浦县| 嘉善县| 十堰市| 巫山县| 陆丰市| 高尔夫| 兴城市| 尤溪县| 洪洞县| 拜城县| 都昌县| 琼结县| 博白县| 五台县| 南江县| 沁源县| 抚州市| 报价| 洛宁县| 朝阳市| 阳谷县| 宝兴县| 宁强县| 广昌县| 巴楚县| 墨江| 济宁市| 交城县| 绥阳县|