Skip to content

This repository contains project templates.

Notifications You must be signed in to change notification settings

sdavids/sdavids-project-template

Repository files navigation

sdavids-project-template

This repository contains project templates—​each template is in its own branch.

The following project templates are available:

docs

an Asciidoc project setup

go-lang

a Go project setup

html-css-js

an HTML/CSS/JS project setup

latex

a LaTeX project setup

rust-lang

a Rust project setup

swift-lang

a Swift project setup

⚠️

All branches of this repository will be force-pushed to—​this is unfortunately necessary so that using this template project is easy.

  1. Install GitHub CLI.

  2. Initialize a new repository from this template repository:

    $ gh repo create my-project --clone --template=sdavids/sdavids-project-template --private --include-all-branches
    $ cd my-project

    Alternatively, you can use the following two shell functions:

  3. Browse the available project templates:

    $ git ls-remote --quiet --branches origin | awk '{print $2}' | cut -d '/' -f3 | grep -v main
    ...
    go-lang
    ...
    💡

    Use a graphical Git tool for this step.

  4. Cherry-pick the single commit from the appropriate branch to set up a project (e.g. go-lang):

    $ git cherry-pick --no-commit --strategy-option=theirs $(git rev-parse origin/go-lang)
    $ git commit --amend --no-edit
    $ git push --force-with-lease
    💡

    Use a graphical Git tool for this step if you want more control over the cherry-pick.

  5. Remove the unnecessary branches:

    $ scripts/git_delete_branches.sh

    Afterward keep or delete the script:

    $ rm scripts/git_delete_branches.sh
  6. Install the development environment setup.

  7. Initialize the Git hooks:

    $ git config core.hooksPath .githooks
  8. Set the ignore-revs-file:

    $ git config blame.ignoreRevsFile .git-blame-ignore-revs
  9. Do the TODOs; delete the file afterward:

    $ rm TODO
  10. Amend the initial commit and push to origin:

    $ git commit --amend --no-edit
    $ git push --force-with-lease
  11. Cleanup your local Git repository:

    $ scripts/git_cleanup.sh -e now
  12. Your project is ready to go 🎉

We abide by the Contributor Covenant, Version 2.1 and ask that you do as well.

For more information, please see Code of Conduct.

After initializing this repository you need to install the Git hooks via:

$ git config core.hooksPath .githooks

And configure the ignore-revs-file:

$ git config blame.ignoreRevsFile .git-blame-ignore-revs
$ sudo apt-get install shellcheck
$ brew install shellcheck
$ sudo apt-get install shfmt
$ brew install shfmt

About

This repository contains project templates.

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Languages