Menu

GIT switch branch

git (2)
Nightinggale
Attachments
switch_branch.jpg (24542 bytes)
switch_complete.jpg (10196 bytes)
wrong_branch.jpg (33586 bytes)

This page assumes that you have followed [GIT]

Now that you have git, you need to select which branch(es) you wish to use. First step is to understand what a branch is. Here is a graphical representation of what goes on.

Git workflow
The image is borrowed from here: https://www.atlassian.com/git/workflows#!workflow-gitflow
This tutorial has more detailed information on git, branches and workflow.

Each circle is new/modified files added to git (they are called revisions while the action of making a revision is called to commit).

When you select a branch, you get the flow of a single color and which one to pick depends on what you want.

Branches:
Master: newest stable release. This is by definition the same as downloading the release.
Release: this is what is meant to be next release. It needs playtesting and will only get bugfixes, no new features. The version number of next release is usually added to the branch name.
Develop: This is where new and almost untested features are added.
Feature: (actually named after feature) is major features, which are likely even more unstable than develop. They could even be in a branch of it's own because the partly written feature renders the game unplayable.

Git will actually give you 3 modules. The main one is the mod itself while the two submodules are python and DLL source code. Each will follow a branch and they don't have to follow the one named the same.

Usually you want to use master to release unless you work actively in the module in question. A mod, which is purely based on XML will likely benefit the most from using master for the two submodules as this gives the best stability.

How to actually select branch:

When you clone you get the master branch. Sadly you will have to set branches of the submodules yourself after cloning and after switching branch in master.

Notice the red circles. They tell which branch each module tracks. The two submodules track something, which starts with weird looking names. Those will not update and you will have to select a branch for each.

Select the line with a module and look at branches (bottom left of the wndow)

Here you can select which branch you want to track. You start with a local copy of master, but if you open origin you get all the branches, which are currently available on Sourceforge.

Right click to bring up the menu and select switch branch to switch. Confirm that you want to switch and start local tracking if asked (this will make more branches in local branches).

If done correctly you will get something looking like this.

Updating with new data from Sourceforge is done by selecting a branch line in Directories and then click pull in the top left. This will have to do be done for each module.

TODO: write script to update submodules automatically when main module updates.

Once you have selected branches, you are ready to [compile]


Related

Wiki: GIT
Wiki: compile

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.