“I'm not a great programmer; I'm just a good programmer with great habits.”
- Workflow Definition
“A workflow consists of repeatable activities necessary to complete a task.”
Learn the skills required to work a collaborative software project using only Markdown. Limiting your projects to Markdown lets you focus on the big picture without getting distracted by more challenging code.
It is an overview and a big picture of Git and GitHub workflow.
Abstract Workflow Flowchart Source
Detailed workflow steps on remote repository (GitHub) and local repository (your computer).
Priorities: 🥚, 🐣, 🐥, 🐔 (click to learn more)
There is a lot to learn in this repository. If you can't master all the material at once, that's expected! Anything you don't master now will always be waiting for you to review when you need it. These 4 emoji's will help you prioritize your study time and to measure your progress:
- 🥚: Understanding this material is required, it covers the base skills you'll need for this module and the next. You do not need to finish all of them but should feel comfortable that you could with enough time.
- 🐣: You have started all of these exercises and feel you could complete them all if you just had more time. It may not be easy for you but with effort you can make it through.
- 🐥: You have studied the examples and started some exercises if you had time. You should have a big-picture understanding of these concepts/skills, but may not be confident completing the exercises.
- 🐔: These concepts or skills are not necessary but are related to this module. If you are finished with 🥚, 🐣 and 🐥 you can use the 🐔 exercises to push yourself without getting distracted from the module's main objectives.
Practice the foundational workflows of software development by learning to write Markdown locally on your own computer using Visual Studio Code (VSCode), the Command Line Interface (CLI), and NPM scripts to automate your code's quality (formatting, linting and spell checking).
- 🥚 Folder Structures: You can explain how files and folders are stored in your computer and can find, open or create files in your computer without using the Command Line Interface.
- 🥚 Command Line Interface (CLI): In a Unix shell you can ...
- Open a new terminal window
- Navigate up and down directories using
cd
- List the contents of a directory using
ls
- View the contents of a file using
cat
- Create new files using
touch
- Create new folders using
mkdir
- 🥚 Markdown: You can write a document in Markdown with no syntax mistakes that renders into a well-formatted document.
- 🥚 VSCode: You can complete these workflows in VScode, and can use
keyboard shortcuts to complete them all:
- Opening a repository in a new window
- Opening the VSCode terminal
- Adding a new file
- Adding a new folder
- Deleting a file
- Deleting a folder
- Previewing a Markdown File
- Formatting a Markdown document
- 🥚 READMEs: You can write a README file that describes the project you are working on, why it's helpful, and how someone can use it.
- 🥚 NPM: You can use NPM commands to verify your code's quality, this
includes ...
- Using
npm install
to install a project's dependencies - Reading a
package.json
file to find which scripts are available for the project - Use
npm run <script>
to execute an npm script
- Using
- 🥚 Formatting Code: You can use Prettier to make sure all the code in your
project is well-formatted:
- You can use the Prettier VSCode extension to format a document while you are writing it
- You can use
npm run format
to format all of the documents in your project - You can use
npm run format:check
to make sure all files are well-formatted
- 🥚 Linting Folder and File Names: You can ...
- Use
npm run lint:ls
to check all folder and file names in your project - You can fix all linting mistakes reported by
npm run lint:ls
- Use
- 🥚 Linting Code: You can ...
- Use
npm run lint:md
to check all Markdown files in your folder for linting mistakes - You can fix all linting mistakes reported by
npm run lint:md
- Use
- 🥚 Spell Check: You can ...
- Use the Code Spell Checker VSCode extension to correct spelling mistakes in your Markdown documents while you are writing
- Use
npm run spell-check
to check the spelling in all the files of your project - Update
.cspell.json
to add words that should be allowed in your project
- 🥚 File and Folder Naming Conventions: You can ...
- Identify and follow the naming conventions for the project you are working on.
- Use
npm run lint:ls
to check that all files and folders follow the project's naming conventions. - You can correct any file and folder names to make them match the project conventions.
- 🐣 File Extensions: You can identify all of the languages covered at HYF and give the correct file extension. You don't need to know the languages, just recognize them.
- 🐣 Touch Typing: You can write a Markdown file without looking at your keyboard to find any letters, numbers or special characters. (slowly is ok!)
Practice using Git to save and organize your development process. You will learn how you can use Git to go back to previous versions of your project, and to work on different changes in parallel.
- 🥚 Git: Using the CLI you can ...
- Initialize a new git repository with
git init
- Stage changes using
git add <path>
- Check what is staged with
git status
- Commit changes using
git commit -m <message>
- Display your repository's git history using
git log
- Create a new branch using
git branch <branch-name>
- Check out a branch using
git checkout <branch-name>
- Create a new branch and check it out using
git checkout -b <branch-name>
- Merge changes from one branch to another using
git merge <branch-name>
- Update current branch (your branch) from main branch:
- Check out to main branch using
git checkout main
- Pull changes from remote repository using
git pull
- Check out to your branch using
git checkout <branch-name>
- Merge changes from main branch to your branch using
git merge main
- Check out to main branch using
- Merge changes from main branch to current branch in one step using
git pull origin main
- Return to a previous version of your project with
git log
andgit checkout <commit-hash>
- Stash and retrieve uncommitted changes with
git stash
andgit pop
- Display list of existing remote URLs using
git remote -v
- Add a new remote repository URL using
git remote add <shortname> <remote-url>
- Update a remote repository URL using
git remote set-url <exsit-shortname> <new-remote-url>
- Rename a remote repository URL using
git remote rename <old-shortname> <new-shortname>
- Remove a remote repository URL using
git remote rm <exsit-shortname>
- Initialize a new git repository with
- 🥚
.gitignore
: You can use a.gitignore
file to describe which files you don't want included in your git history. - 🥚 VSCode: You can ...
- Use the Git Graph extension to to visualize your repo's commit history
- Use the Git Lens extension to investigate your repository's commit history
- Explain how the file tree in VSCode can show you which files have uncommitted changes
- 🥚 Atomic Commits: You can save your development progress using small commits with clear and helpful message.
- 🐣 Feature Branches: You can organize your development process using
branches. You can create a new branch for each part of your project and
merge those changes to
main
when they are finished.
Learn how you can connect your local Git repositories with a GitHub repository to add more structure to your development process and to share your projects.
- 🥚 Licenses: You can ...
- Explain why it's important to include a license for your code on GitHub
- Choose a license for your projects that matches how you want others to use your code
- 🥚 GitHub SSH Key: You can connect your computer to your GitHub account using an SSH key, clone using the SSH link, and push/pull using your SSH connection.
- 🥚 GitHub Repositories: You can ...
- Create new repository on GitHub
- Write a description for your repository
- Turn on GitHub Pages
- Configure your repository to block pushing to
main
- Configure your repository to block merging to
main
until Continuous Integration (CI) checks have passed
- 🥚 Git Remote/Local Connection: You can ...
- Clone a remote repository to your computer using
git clone <remote-url>
- initialize a new repository locally and connect it to an empty remote repository
-
git push
command is used to upload local repository content to a remote repository -
git fetch
a primary command used to download contents from a remote repository -
git pull
command downloads the changes directly and then applies those changes to the current working files -
push
andpull
changes between remote & local branches - You can distinguish between
git fetch
andgit pull
- Clone a remote repository to your computer using
- 🥚 Pull Requests: You can create a pull request between two branches in your repository and merge changes without causing any conflicts.
- 🥚 PR templates: You can use a PR template to add a checklist to all
of your PRs so you are sure the code is great before merging to
main
. - 🥚 Continuous Integration: You can use GitHub Actions to check your
code's quality before merging a pull request to the
main
branch. - 🐣 Local/Remote Branching Workflow: You can use a branching workflow
that keeps mistakes away from the
main
branch and prevents conflicts from happening in GitHub. For each contribution to the project you can ...- Check out a new local branch and write your code
- Check out
main
on your local machine - Pull changes from remote
main
to localmain
- Merge changes locally from
main
to your new branch- Fix any conflicts on your new branch before pushing!
- Format and lint your code
- Push your new local branch to your remote repository
- Open a Pull Request from the new branch to
main
- Go through the PR's checklist to make sure everything is correct
- Make sure all CI checks pass!
- Merge your new remote branch to
main
- You can delete the branch after it's merged if you want to
Learn how to collaborate with a group on a single project hosted in a GitHub repository. Practice using GitHub's project management features to organize your group's tasks and to double-check your project's code quality.
- 🥚 Contributor Guidelines: Your group can define contributor guidelines that describes how everyone can add their work to the project.
- 🥚 Code of Conduct: Your group can write a code of conduct for your project that describes how everyone should communicate and what behavior is considered unproductive.
- 🥚 Repository Contributors: You can add group members as collaborators in a repository.
- 🥚 Issue Templates: Your group can use issue templates to make sure all issues are complete and relevant to the project. in your repository and merge changes without causing any conflicts.
- 🥚 Code Review: You can use the PR Template and CI checks to review
another group member's code before merging it to
main
. - 🐣 GitHub Project Management: You can ...
- Use issues to define tasks in a group project. Each issue should have a helpful title, complete description, and helpful labels.
- Use a Project Board to organize a project's issues
- Claim issues and track your progress with the project board
- Link a PR to your claimed issue
- Assign someone to review your PR
- Use GitHub code review features to discuss your code with your reviewer
- 🐣 Fixing Merge Conflicts: You can fix merge conflicts by selecting which change to keep, or deciding how to combine them. If a conflict occurs in a GitHub PR you can pull both branches and fix the conflict locally.
Explore the wider world of Open Source software by learning how communities of independent developers write and maintain the code we all rely on.
- 🥚 Finding Issues: You can read through an open source project's issues and determine if there is one you can help with.
- 🐣 Commenting in Issues: You can productively join the conversation in an open source projects' issues.
- 🐥 Opening Issues: You can open a helpful issue in an open source repository, following their contributor guidelines and code of conduct.
- 🐔 Contributing: You can create a fork of an open source project and open a PR that contributes something helpful and follows the Contributor Guidelines and Code of Conduct.
expand/collapse
- Don't rush, understand! Programming is hard.
- The examples and exercises will still be there to study later.
- It's better to fail tests slowly and learn from your mistakes than to pass tests quickly and not understand why.
- Don't skip the examples! Understanding and experimenting with working code is a very effective way to learn programming.
- Write lots of comments in the examples and exercises. The code in this repository is yours to study, modify and re-use in projects.
- Practice Pair Programming: two people, one computer.
- Take a look through the Learning From Code guide for more study tips
Creating a project board on your GitHub account for tracking your study at HYF
can help you keep track of everything you're learning. You can create the board
at this link: https://github.com/your_user_name?tab=projects
.
These 4 columns may be helpful:
- todo: material you have not studied yet
- studying: material you are currently studying
- to review: material you want to review again in the future
- learned: material you know well enough that you could help your classmates learn it
You will need NPM installed on your computer to study this material
- Clone this repository:
- using SSH:
git clone --depth 1 [email protected]:HackYourFutureBelgium/workflows.git
- using SSH:
- Navigate to the cloned repository
cd workflows
- Install dependencies:
npm install
It's highly recommended that you use either Linux or Mac. If you have a Windows computer you can either dual-boot your computer or install a virtual machine.
expand/collapse
This repository comes with some scripts to check the quality of this code. You can run these scripts to check the code provided by HYF, and to check the code you write when experiment with the examples and complete the exercises.
This script will format all of the code in this repository making sure that all the indentations are correct, the code is easy to read, and letting you know if there are any syntax errors.
Checks the formatting of all files in the repository and throws an error if any files are not well-formatted.
This script will check all of the files in your repository for spelling mistakes. Spelling is not just a detail, is important! Good spelling helps others read and understand your programs with less effort.
spell-check
is not so clever though, it doesn't have all possible words in
it's dictionary and it won't know if you wanted to spell a word incorrectly.
If you think one of it's "Unknown word"s is not a problem, you can either ignore
the suggestion or add the word to the "words": [ ... ],
list in
.cspell.json.
This script will lint all the Markdown files in this repository, checking for syntax mistakes and other bad practices. Fixing linting errors will help you learn to write better code by pointing out your mistakes before they cause problems in your program.
Some linting errors will take some practice to understand and fix, but it will be a good use of time.
This script will lint the names of all files and folders in the project to check that they follow the project naming convention (kebab-case).