Branching Out On Your Story

Before you start writing code you should create a branch to add the code to in your git repository. You could decide to create the branch directly in your IDE if it has Git support, or if you are using an external tool like Git Tower or SourceTree you could create the branch there. I’m going to use VSTS to create my working branch and then pull that branch down to IntelliJ IDEA just to show you an alternative method.

In the story you just dragged over to the Active column you will see a small — menu in the upper right when you hover over the story. Clicking on this will bring up a context menu with some interesting items on it like adding tasks and tests which I’ll mention much later in another posting but for now I’m interesting in the ‘New Branch…’ menu. Go ahead and click on that.

A new dialog will appear asking for your branch name. You can call it whatever you want. I like to try link the branch name to the story somehow so I’m going to call mine ‘Story667-CreateHomePage’

IntelliJ IDEA has no idea that this branch exists so we need to tell it about the branch by fetching it from the server.

Using the VCS menu, go to Git and then select ‘Fetch’. This will pull down all the changes on the server but it does not change your current branch.

We can see that it has worked by looking in the Version Control log which is available by clicking the Version Control tab in the lower toolbar of IntelliJ.

Now go to the VCS -> Git -> Branches screen and you see the new remote branch.

Click on it and select the option to ‘Checkout as a new local branch’.

Now you can start writing code.

Tagged with: , ,
Posted in Domino To Spring, None
%d bloggers like this: