Skip to content
Bradley Grainger edited this page Oct 16, 2017 · 15 revisions

Faithlife C# Template Project

Follow these steps to create a new project/repo based on this template. It is assumed that the project name has one or more periods, e.g., Faithlife.Xyz, and the repo name does not, e.g., FaithlifeXyz. In the instructions below, replace these terms with your project's/repo's name as appropriate.

Clone the template

# clone the template repo
git clone git@github.com:Faithlife/CSharpTemplate.git FaithlifeXyz

# remove the template repository as the origin (a new origin will be added later)
cd FaithlifeXyz
git remote rm origin
git checkout -b master
git branch -D template

Modify the code

\\dev\util\FindReplaceCode\FindReplaceCode . ProjectName Faithlife.Xyz RepoName FaithlifeXyz
git add -A
git commit -m "Globally replace template placeholder strings."

Create a gh-pages branch for documentation

# create a new branch with no content
git checkout --orphan gh-pages
git rm -rf .
git clean -fdx

# initialize with the template's docs
git remote add template git@github.com:Faithlife/CSharpTemplate.git
git fetch template
git reset --hard template/gh-pages

# customize the template
\\dev\util\FindReplaceCode\FindReplaceCode . ProjectName Faithlife.Xyz RepoName FaithlifeXyz
git add -A
git commit -m "Replace documentation template placeholder strings."

Create a repository

  1. Create a new repository at https://github.com/Faithlife.
  2. Click the button to add collaborators; add Builders with Write permission; add Coders with Write permission.
  3. Click Options; disable Wiki and Projects.

Push the documentation branch

# add the origin; the exact URL to use is at the GitHub repo main page
git remote add origin git@github.com:Faithlife/[RepoName].git
git push -u origin gh-pages

Set up CI builds

Travis CI

  1. Go to https://travis-ci.org/.
  2. Click + next to "My Repositories".
  3. Click Faithlife on the left.
  4. Click Sync account button in top right.
  5. Find FaithlifeXyz in the list and enable it.

Appveyor

  1. Go to https://ci.appveyor.com/projects.
  2. Click New Project.
  3. Find FaithlifeXyz in the list and click the Add button that appears on the far right on hover.

Push the code

git checkout master
git push -u origin 

Change more GitHub settings

  1. Go back to the repo settings page
  2. Under Branches:
  3. Change default branch to master; click Update
  4. Select master under Protected Branches and check Protect this branch.
Clone this wiki locally