8

# 8Brackets and remote repositories

## Extending the current project

Currently the project looks like this:

There is a single master branch with eight commits and the head is at the most recent commit, in my case [07fe437]. In Brackets, the history is:

The repository has the following eight files:

LIST OF FILES AT COMMIT 07FE437   TAG: P03

index.html

01-intro.html

.gitignore

11-resources\01-css\style.css

11-resources\02-images\logo.png

Table 8.1   File list at commit point P03 [07FE437]

Before we start working with the remote repository, I want to create a new branch and commit point in the local project—this is to demonstrate how GitHub handles branches.

I’m going to add a new 03-contact.html page and I’m going to do so by creating a new branch from the most recent commit point [07fe437] on the master branch. From the master branch, create a new d-03-contact branch and switch to it (see § 6.5 for instructions about creating and changing branches).

Now we have Figure 8.3, the head is on the new branch, but there are no further commits yet (to make the diagram readable, I’ll only show the most recent commits):

Time for another file; in the new d-03-contact branch create a file 03-contact.html in the root folder (same place as index.html) and add the following code to it (This is just like we did in § 6.5.2):

03-contact.html
<html lang="en">                     <!-- Declare language -->
<meta charset="utf-8">       <!-- Use Unicode character set  -->

<body>
<h1>A Practical Series Website</h1>

</body>
</html>

 Code 8.1   d-03-contact branch—create new file: 03-contact.html a

Save the file and in the Git pane tick the box to stage the file:

Commit the changes with the commit message:

D: Incremental Build - 03-contact page

Give the new commit point the tag d-P03.03.01. In my case the commit point is [8329b67].

I now have nine commits:

The workflow is:

The last thing is to switch back to the master branch, the master branch is still the only deployable branch and it is this branch that I want to upload to the remote repository first.

Click the arrow next to the d-03-contact branch and select master from the dropdown.

This gives the following: back on the master branch there are only eight commits and the new file 03-contact.html is not in the file list (this is on the d-03-contact branch and not visible from the master branch):

The work flow is now (just the same but with the head on the master branch):

Leave it like this for now while we get the remote repository established.