Workflow Part 3: GitHub Push

In this part of our Workflow series, we’ll guide you through organising your posts and pushing them to GitHub. We’ll discuss two processes: a simple one for working with your AI friend, and a more complex one for collaborating with teams.

Getting Your Posts in Order

To prepare posts for GitHub, ensure they are organised correctly:

  1. Store posts in appropriate directories. For example, all publishing posts go under ./content/publishing/.
  2. Each post should be in a subdirectory with a single file named index.md. Example: ./content/publishing/overview/index.md.
  3. Different topics should be in separate directories, such as ./content/bayesian.
  4. Configure the menu in the config.toml file.

Simple Git Process for One Person and AI Friend

For a single user collaborating with an AI, follow these steps:

  1. git status to check the status of your local repository.
  2. git add . to stage all changes.
  3. git commit -m "Your commit message" to commit your changes.
  4. git push origin main to push your changes to the main branch.

Advanced Git Process for Teams

For teams, use a feature branch workflow:

  1. git status to check the status of your local repository.
  2. git checkout -b feature/my-feature to create a new feature branch.
  3. git add . to stage all changes.
  4. git commit -m "Your commit message" to commit your changes.
  5. git push origin feature/my-feature to push your feature branch to GitHub.
  6. Create a merge request to merge your feature branch into the main branch.

Other helpful Git commands:

  • git branch to check your current branch.
  • git pull to update your local branch with the latest changes from the remote repository.

Using .gitignore

The .gitignore file helps you exclude certain files from being committed to the repository. Some good files to include in .gitignore are:

  • .DS_Store (if you’re on a Mac)
  • node_modules/
  • .env

Feel free to add more files and directories to the .gitignore file as needed.

With these tips, you’ll be able to efficiently organise, commit, and push your posts to GitHub, whether you’re working alone or with a team. Stay tuned for our next Workflow instalment!