General admin content


May 14, 2024

This contains details for general administration of projects. For the most part, this document is only relevant to the team leader or if someone else has taken those admin responsibilities.

GitHub Repository Settings

  • Always protect the main branch of the repository to limit forced pushes and deletions. Within the branch protection settings, enable (check mark) these options in order to provide more security and checks to protect the main branch:
    • “Require approvals”, of at least 1 team members
    • “Dismiss stale approvals when new commits are added”
    • “Allow specified actors to bypass requirements”, the actor being the team leader
    • “Require approval of most recent reviewable push”
    • “Require status checks to pass before merging”
    • “Restrict who can push to matching branches” for the main branch

Whenever a new GitHub repo is created for a new website or software project, run this Terminal command on it in order to set some default options for the newly created repository. These options set up the repository with things that we need (and omit things we don’t need). The command sets up the following settings:

  • Delete branches after they’ve been merged
  • Omit wiki
  • Disable discussions
  • Allow PR’s to have an option to auto-merge after approval
  • Allow PR’s to have an option to easily update with the main branch.
gh repo edit --delete-branch-on-merge=true --enable-wiki=false --enable-discussions=false --enable-auto-merge=true --allow-update-branch

Creating a GitHub repo from a local one

If a local repository exists and a GitHub repository needs to be created for that repository, run this command in the Terminal while inside the local Git repository folder (the root folder of the Git repository), that does the following actions:

  • Creates a repo in the seedcase-project organization called REPO (rename to the folder name of the local repo).
  • Sets the repo to public (not private) via the --public flag.
  • Uses the root folder as the local Git repository with --source=..
  • Includes a description of the newly created repository with --description="WRITE DESCRIPTION" (write the description of what’s in the repo instead of WRITE DESCRIPTION).
  • Pushes the local repo to the new repo with --push.
  • Disables the wiki with --disable-wiki.
  • Sets the URL for the homepage with --homepage (change REPO in the link following this flag with the name of the root folder of the Git repo).
gh repo create seedcase-project/REPO --public --source=. --description="WRITE DESCRIPTION" --push --disable-wiki --homepage