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. |
-
Install GitHub CLI.
-
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:
-
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.
-
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.
-
Remove the unnecessary branches:
$ scripts/git_delete_branches.sh
Afterward keep or delete the script:
$ rm scripts/git_delete_branches.sh
-
Install the development environment setup.
-
Initialize the Git hooks:
$ git config set core.hooksPath .githooks
-
Do the TODOs; delete the file afterward:
$ rm TODO
-
Amend the initial commit:
$ git commit --amend --no-edit
-
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
-
Cleanup your local Git repository:
$ scripts/git_cleanup.sh -e now
-
Your project is ready to go 🎉
❗
|
After initializing this repository you need to install the Git hooks via: $ git config set core.hooksPath .githooks |