Skip to content

This repository contains project templates.

Notifications You must be signed in to change notification settings

sdavids/sdavids-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

go-lang-server-http

a Go HTTP(S) server 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 set core.hooksPath .githooks
  8. Do the TODOs; delete the file afterward:

    $ rm TODO
  9. Amend the initial commit:

    $ git commit --amend --no-edit
  10. Push to origin:

    $ git push --force-with-lease

    Alternatively, you can delete the created GitHub repository and republish it:

    $ gh repo delete my-project --yes
    $ gh repo create my-project --source . --push --private

    Or with the repo_publish_to_gh shell function:

    $ gh repo delete my-project --yes
    $ repo_publish_to_gh
  11. Cleanup your local Git repository:

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

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

$ git config set core.hooksPath .githooks
$ sudo apt-get install shellcheck
$ brew install shellcheck
$ sudo apt-get install shfmt
$ brew install shfmt

About

This repository contains project templates.

Topics

Resources

Stars

Watchers

Forks

Languages