Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change order of first steps in docs #14

Merged
merged 5 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repos:
description: Checks file ends on newline
- id: no-commit-to-branch
name: No direct commit to main
args: ['--branch', 'main']
description: Do not commit to main directly
- id: trailing-whitespace
name: Trim trailing whitespaces
Expand Down
4 changes: 2 additions & 2 deletions docs/source/usage/cocogitto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ One is that the changelog is generated via GitHub's CI relative to the first tag
therefore need to delete any existing ``CHANGELOG.md`` and then add this tag to your GitHub repository,
either on GitHub or by pushing the tag from your local repository, e.g.

a. ``git tag -a v0.0.0 -m "init repo"``,
b. ``git push --tags``.
a. ``git tag -a v0.0.0 -m "init repo"``
b. ``git push --tags``

You also need to modify some settings in the ``cog.toml`` file under ``[changelog]``:
- ``repository = "[your_repo_name]"``
Expand Down
59 changes: 31 additions & 28 deletions docs/source/usage/getstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,36 @@ Necessary first steps:
###########################

#. Create an empty GitHub repository and set the remote url for your new project to it.
a. delete ``[email protected]:yoctoyotta1024/GoodSciProjTemplate.git`` from your remote with ``git remote remove origin``,
b. add your repository: ``git remote add origin [[email protected]:your_repository_ssh.git]``,

#. Make yourself the ``github.repository_owner`` who triggers GitHub's CI to publish documentation (see `.github/workflows/CI.yaml`).
#. Set your documentation to deploy using the `/(root)` folder of your gh-pages branch (see `instructions for gitHub publishing <https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site>`_).
#. Switch to a new branch using git and start customising the template...

Necessary second steps:
#######################

#. Create the 0th version tag in the remote repository:
a. ``git tag -a v0.0.0 -m "init repo"``,
b. ``git push --tags``.

#. Delete GoodSciProjTemplate's CHANGELOG.md ``rm CHANGELOG.md``.
a. delete ``[email protected]:yoctoyotta1024/GoodSciProjTemplate.git`` from your remote with ``git remote remove origin``
b. add your repository: ``git remote add origin [[email protected]:your_repository_ssh.git]``
#. Switch to a new branch (not main!): ``git switch -c [branch_name]``, and start customising
the template... *(hint: each of the following changes is a seperate commit. Remember to use coventional
commit messages and don't push to your remote branch until the end.)*
#. Make yourself the ``github.repository_owner`` who triggers GitHub's CI to publish documentation
(see `.github/workflows/CI.yaml` and `.github/workflows/cocogitto.yaml`).
#. Make the project name yours instead of "GoodSciProjTemplate".
#. Make the citation and liscence refer to you instead of me.
#. Corect the repository name and its owner for GitHub (e.g. in the CI.yaml).
#. Correct the repository name and its owner for GitHub (e.g. in the `.github/workflows/CI.yaml`).
#. Write a new README.md (shorter is generally better) and include a link to your documentation in it.
#. Change the GitHub links in the .rst files to the correct ones for your GitHub repository
(*hint*: you find these files in the `docs` directory).
#. Commit and push your changes to a branch of your GitHub repository (not main!).
#. Create a pull request and accept it if your CI succeeds in order to to merge/rebase your
changes to the main branch of your remote (GitHub) repository.
#. Update your local main branch and any other local branches your have.
#. Delete GoodSciProjTemplate's CHANGELOG.md ``rm CHANGELOG.md``.
#. Delete any pre-existing tags and push a 0th version tag to your remote repository:
a. ``git tag`` to see any pre-existing tags, then ``git tag -d [pre-existing_tags]``
b. ``git tag -a v0.0.0 -m "init repo``
c. ``git push --tags``
#. Setup (or delete) cocogitto (see :doc:`cocogitto`).
#. Build (or delete) C++ code in the repository (see :doc:`pybind11`).
#. Push all your changes to a branch of your GitHub repository (not main!).
a. ``git push --set-upstream origin [branch_name]``

Necessary second steps:
#######################

#. Create a pull request and accept it if your CI succeeds in order to to merge/rebase your
changes to the main branch of your remote (GitHub) repository.
#. Set your documentation to deploy using the `/(root)/` folder of your gh-pages branch
(see `instructions for gitHub publishing <https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site>`_).


Some suggested third steps:
Expand Down Expand Up @@ -108,23 +111,23 @@ Always keep your local main branch up to date with its remote version! Everytime
you should perform ``git switch main`` then ``git pull`` (or ``git fetch`` and ``git merge``).

#. Before you start making any change to your repo, you should first branch off your main branch:
a. ``git switch main``,
b. ``git switch -c [branch_name]``.
a. ``git switch main``
b. ``git switch -c [branch_name]``
#. Make the changes you want and stage them with:
a. ``git add -p`` (accept / decline changes).
a. ``git add -p`` (accept / decline changes)
#. Commit your changes (frequently!!) with:
a. ``git commit -m "<type>[optional scope]: <description>"``,
b. See `conventional commit guidelines <https://www.conventionalcommits.org>`_ for writing good commit messages.
a. ``git commit -m "<type>[optional scope]: <description>"``
b. See `conventional commit guidelines <https://www.conventionalcommits.org>`_ for writing good commit messages
#. Push your changes to your remote repository with ``git push``.
#. Create a pull request to merge/rebase your changes to your remote main branch.
#. Delete your local (and remote) branch after your pull request is accepted:
a. ``git branch -d [branch_name]``.
a. ``git branch -d [branch_name]``
#. Start a new branch from main to make further changes.

If you happen to be working on a branch at the same time that changes to the main branch occur,
make sure to keep your branch up-to-date! The more your branch differs from main, the more likely
you will encounter merge conflicts (not fun!). Keep your branches up to date by keeping your local
main branch up-to-date and then keeping your branches up-to-date with your local main branch. E.g.

a. ``git switch main`` then ``git pull``,
b. ``git switch [branch_name]`` then ``git rebase main``.
a. ``git switch main`` then ``git pull``
b. ``git switch [branch_name]`` then ``git rebase main``
Loading