GitHub Setup — Account, Repository, Push, and Personal Access Token

Complete guide to setting up GitHub for Dax Pro: create a GitHub account, create a repository, push your local project, and generate a personal access token for Netlify Git Gateway. This is the prerequisite for cloud deployment and Decap CMS in production.

Why GitHub Is Required

Dax Pro builds a static site from your local files. That works fine on your machine. But the moment you want to do any of the following, GitHub becomes mandatory:

  • Deploy to Netlify, Vercel, or Azure Static Web Apps — all of these connect to a Git repository and build from it
  • Use Decap CMS in production — Decap commits content changes to a Git repository, which triggers a rebuild
  • Collaborate with editors — multiple people editing content need a shared source of truth
  • Keep a backup — a GitHub repository is the backup
  • Without GitHub, you have a local-only site. With GitHub, you have a deployable, editable, shareable site.

    This chapter walks through the four tasks that prepare GitHub for Dax Pro:

    1. Create a GitHub account — sign up, verify email, choose a username

    2. Create a repository — the cloud folder that will hold your project

    3. Push your local project — send your Dax Pro files to the repository

    4. Generate a personal access token — the credential Netlify uses to connect to your repository on your behalf

    Each step is illustrated with exact commands and screenshots-in-words. Follow them in order.


    Part 1 — Create a GitHub Account

    If you already have a GitHub account, skip to Part 2.

    Step 1: Sign Up

    1. Open github.com in a browser

    2. Click Sign up in the top-right corner

    3. Enter your email address — use an address you check regularly. This is where GitHub sends verification links, security alerts, and (if you use GitHub Pages) domain verification notices

    4. Choose a password — at least 15 characters or 8 characters with a number and lowercase letter. Use a password manager if you have one

    5. Choose a username — this becomes part of your repository URLs and your public profile

    Username guidelines:

  • Use lowercase, hyphens if needed. No spaces.
  • Professional usernames work better than personal ones if you might share the repository with clients: john-designer, sarahux, your-company-name
  • Avoid names that include the year or a version number — you will want the same username in five years
  • If your first choice is taken, try yourname-dev, yourname-design, or yourname-2
  • 6. Complete the CAPTCHA and click Create account

    7. GitHub sends a verification email. Open it and click the verification link

    8. If you do not see the email within a minute, check your spam folder. GitHub's verification emails sometimes land there

    Step 2: Configure Your Profile (Optional but Recommended)

    After verification, GitHub may ask about your experience level and what you plan to use GitHub for. These answers are used to customize your dashboard; they do not affect functionality. Skip them if you prefer.

    Step 3: Verify You Can Log In

    Log out and log back in at github.com/login. If you can log in, the account is ready.


    Part 2 — Create a Repository

    A repository (repo) is the cloud folder that holds your project. It tracks every change, every version, and every collaborator.

    Step 1: Open the New Repository Page

    1. Log in to GitHub

    2. Click the + icon in the top-right corner

    3. Choose New repository

    Alternatively, navigate directly to github.com/new .

    Step 2: Fill In Repository Details

    Repository name: the name of the folder on GitHub. Use lowercase with hyphens.

  • If your site is at daxpro.axcora.com, use daxpro-site or daxpro-website
  • If this is a personal site, use yourname-site
  • Do not use spaces or special characters
  • Description: optional. One sentence describing the project. Example: "Dax Pro static site for enterprise .NET services."

    Visibility:

  • Public — anyone can see the repository. Use this for open-source projects or portfolio sites. GitHub Pages (if you use it) requires public repositories for free accounts
  • Private — only you and invited collaborators can see it. Use this for client work, internal sites, or anything you do not want indexed by search engines
  • For a Dax Pro site deployed to Netlify, Private is the safe default. Netlify can build from private repositories on its free plan. The site itself is still public at your domain — only the source code is private.

    Initialize this repository with:

  • Do not check "Add a README file." You already have a README.md in your Dax Pro project. Adding another creates a conflict.
  • Do not check "Add .gitignore." You already have a .gitignore in the project.
  • Do not choose a license. You already have a LICENSE file.
  • Leave all three checkboxes empty.

    Step 3: Create the Repository

    Click Create repository. GitHub creates an empty repository and shows you a page with setup instructions.

    The page shows two sections: "Quick setup" and "…or push an existing repository from the command line." The second section contains the commands you need for Part 3.

    Copy the repository URL. It looks like:

    https://github.com/your-username/your-repository.git
    

    You will need this URL in the next step.


    Part 3 — Push Your Local Project

    Your Dax Pro project is on your local machine. Pushing it means sending all files to the GitHub repository so they are stored in the cloud.

    Step 1: Open a Terminal in Your Project Folder

    Open a terminal (or Command Prompt on Windows, or Terminal on macOS) and navigate to the Dax Pro project folder:

    cd ~/Projects/dax-pro
    

    Confirm you are in the right folder:

    ls
    

    You should see _data, content, templates, public, Dax.csproj, and Program.cs.

    Step 2: Initialize Git (If Not Already Done)

    If the project folder has a .git/ directory, Git is already initialized. Check:

    ls -la | grep .git
    

    If you see .git/, skip to Step 3.

    If you do not see .git/, run:

    git init
    

    This creates a local Git repository in the project folder.

    Step 3: Configure Git Identity

    Git needs to know who is committing. Configure it globally (once per machine):

    git config --global user.name "Your Name"
    

    git config --global user.email "[email protected]"

    Use the same email you used for GitHub. This is how commits are attributed to your account.

    Verify:

    git config --global user.name
    

    git config --global user.email

    Step 4: Add Files to the Staging Area

    Git tracks changes in three stages: working directory, staging area, and repository. To send files to GitHub, they must first go through staging.

    git add .
    

    The . means "add everything in this folder." This stages all files, including the ones you just extracted and the changes you have made since.

    Check what is staged:

    git status
    

    You should see a list of new files in green. If you see unexpected files (like bin/ or obj/ from a .NET build), check your .gitignore. Dax Pro ships with a .gitignore that excludes bin/, obj/, site/, and other build artifacts.

    Step 5: Commit the Files

    A commit is a snapshot of the staged files with a message describing what changed.

    git commit -m "Initial commit: Dax Pro project"
    

    The -m flag provides the commit message inline. Keep messages short and descriptive.

    Step 6: Rename the Branch to main

    Git's default branch name has historically been master. GitHub's default is now main. If your local Git is configured to use master, rename it:

    git branch -M main
    

    The -M flag force-renames the current branch to main, matching GitHub's default .

    Step 7: Connect Local Repository to GitHub

    Add the GitHub repository URL as the remote origin:

    git remote add origin https://github.com/your-username/your-repository.git
    

    Replace your-username and your-repository with your actual values. The URL is the one you copied from the GitHub page in Part 2.

    Verify:

    git remote -v
    

    You should see two lines: origin with the fetch URL and origin with the push URL, both pointing to your GitHub repository.

    Step 8: Push to GitHub

    Send the committed files to GitHub:

    git push -u origin main
    

    The -u flag sets origin main as the default upstream, so future pushes can use git push without arguments .

    Step 9: Verify the Push

    1. Open your repository in a browser: https://github.com/your-username/your-repository

    2. Refresh the page

    3. You should see all your project files: _data/, content/, templates/, public/, Dax.csproj, Program.cs, README.md, LICENSE, and the deployment config files

    If files are missing, check the terminal for errors. Common issues:

  • Authentication failed — you need a personal access token (see Part 4). GitHub no longer accepts passwords for Git operations over HTTPS.
  • Remote origin already exists — you have already added a remote. Either remove it (git remote remove origin) and re-add, or update the URL (git remote set-url origin ).
  • Branch mismatch — if you pushed to master instead of main, the GitHub repository shows the wrong branch. Rename locally (git branch -M main) and push again.

  • Part 4 — Generate a Personal Access Token

    GitHub no longer accepts passwords for Git operations over HTTPS. When you run git push, GitHub asks for a "password" — but what it actually wants is a personal access token (PAT). The token is a long string that acts as a password with specific permissions.

    You also need a PAT for Netlify's Git Gateway, which uses it to commit content changes on your behalf when editors use Decap CMS.

    Step 1: Open GitHub Token Settings

    1. Log in to GitHub

    2. Click your profile icon in the top-right corner

    3. Choose Settings

    4. In the left sidebar, scroll to the bottom and click Developer settings

    5. Click Personal access tokens

    6. Choose Tokens (classic) — not "Fine-grained tokens"

    The classic token page lists your existing tokens. If you have never created one, the list is empty.

    Step 2: Generate a New Token

    1. Click Generate new token (top-right)

    2. Choose Generate new token (classic)

    3. GitHub may ask for your password or a two-factor authentication code. Enter it.

    4. Fill in the token details:

    Note: a descriptive name. Example: Dax Pro - Netlify Git Gateway. This is what you will see in the token list later.

    Expiration: choose an expiration period.

  • 90 days is a reasonable default. You will need to regenerate the token when it expires.
  • No expiration is convenient but less secure. If the token leaks, it works forever. Choose this only if you understand the risk and keep the token in a secure password manager.
  • Scopes: select the permissions the token needs.

    For Netlify Git Gateway, the token needs:

  • repo — full control of private repositories. This is required for Git Gateway to commit to private repositories.
  • workflow — update GitHub Actions workflows. Required if your site uses GitHub Actions for deployment (Dax Pro's default GitHub Actions workflow needs this).
  • For pushing from the command line, the token also needs repo. The workflow scope is optional for command-line pushes.

    Check these two boxes:

  • ✅ repo
  • ✅ workflow
  • Leave all other scopes unchecked. Granting more permissions than needed increases risk.

    Why these two specifically: repo lets Git Gateway read, write, and commit to your repository. workflow lets it update the GitHub Actions workflow file if needed. Without repo, Git Gateway cannot commit. Without workflow, it may fail when the repository has GitHub Actions workflows (which Dax Pro includes by default).

    Step 3: Generate and Copy the Token

    1. Scroll to the bottom and click Generate token

    2. GitHub shows the token once. It looks like:

    ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890
    

    3. Copy the token immediately. You cannot see it again after leaving the page. If you lose it, you must regenerate a new one.

    4. Store it somewhere safe — a password manager is ideal. Do not paste it into a text file on your desktop, an email, or a chat message.

    Step 4: Use the Token

    For command-line Git operations:

    When git push asks for a password, paste the token instead. The username is your GitHub username.

    Alternatively, embed the token in the remote URL:

    git remote set-url origin https://your-username:[email protected]/your-username/your-repository.git
    

    This stores the token in .git/config. It is convenient but less secure — if you share the project folder, the token is visible. Prefer the interactive prompt for shared machines.

    For Netlify Git Gateway:

    You will paste the token into Netlify's Git Gateway settings in the next chapter. Keep it handy.

    Step 5: Verify the Token Works

    Test the token by pushing a small change:

    echo "# Test" >> README.md
    

    git add README.md

    git commit -m "Test token"

    git push

    If the push succeeds without asking for a password, the token is configured correctly. If it asks for a password, the token is not being used — check the remote URL or the credential helper.


    Understanding Repository Visibility

    The choice between public and private has implications beyond GitHub.

    Public repository:

  • Anyone can view the code, clone it, and fork it
  • The repository is indexed by Google and other search engines
  • Suitable for open-source projects, portfolios, and sites you want to showcase
  • GitHub Pages works on free accounts only for public repositories
  • Private repository:

  • Only you and invited collaborators can view the code
  • The repository is not indexed by search engines
  • Suitable for client work, internal tools, and sites under development
  • Netlify can build from private repositories on its free plan
  • The deployed site is still public at your domain — only the source is private
  • For Dax Pro, private is the safer default. You can always make it public later if you decide to open-source the site. Changing visibility does not break Netlify or Decap CMS connections.


    Common GitHub Setup Mistakes

    Mistake 1: Using a password instead of a token.

    GitHub removed password authentication for Git operations in 2021. If git push asks for a password and you type your GitHub password, it fails. Paste the personal access token instead.

    Mistake 2: Losing the token.

    GitHub shows the token once. If you navigate away without copying it, you must generate a new one. There is no way to recover the old token.

    Mistake 3: Granting too many scopes.

    A token with admin:org, delete_repo, and other administrative scopes can do damage if leaked. For Dax Pro, repo and workflow are sufficient.

    Mistake 4: Using master instead of main.

    GitHub's default is main. If your local branch is master, the push succeeds but creates a master branch on GitHub. Netlify's default build branch is main. Rename locally before pushing: git branch -M main.

    Mistake 5: Adding a README on GitHub when you already have one.

    If you check "Add a README file" during repository creation, GitHub creates a commit on the repository. Your local push then conflicts with that commit. Leave the checkbox empty when you already have files to push.

    Mistake 6: Forgetting to configure Git identity.

    Without user.name and user.email, commits are attributed to a generic "unknown" identity. Always configure these globally before the first commit.

    Mistake 7: Pushing build artifacts.

    The bin/, obj/, and site/ folders are build outputs. They should not be in Git. Dax Pro's .gitignore excludes them. If you see them in git status, your .gitignore is missing or not working.

    Mistake 8: Not verifying the push.

    Always open the GitHub repository in a browser after pushing to confirm the files are there. A successful git push output does not guarantee the files are in the right branch.


    What You Have Now

    After completing this chapter, you have:

  • ✅ A GitHub account, verified and ready
  • ✅ A repository on GitHub that holds your Dax Pro project
  • ✅ Your local project pushed to the repository (main branch)
  • ✅ A personal access token with repo and workflow scopes
  • ✅ The ability to push changes to GitHub from the command line
The project is now in the cloud. The next chapter covers Netlify Deployment — connecting your GitHub repository to Netlify, enabling Identity and Git Gateway, and getting your site live on a public URL.

→ Continue to Netlify Deployment