Github Git Cheat Sheet



Everything you need to know about getting started with GitHub Actions

GitHub Actions help you automate your software development workflows in the same place you store and collaborate on code. Individual actions are reusable pieces of code that let you build, test, package, or deploy projects on GitHub. But you can also use them to automate any step of your workflow.

How to get started in four simple steps

Github Git Cheat Sheet
  1. Click the “Actions” tab in your repository
    GitHub Actions is tightly integrated with your code and with the rest of the experiences on GitHub.
  2. Choose the workflow that’s best for your type of project
    GitHub Actions offers helpful workflow templates to get you started, including templates for Node.js, Rust, .NET Core, and more.
  3. Customize your workflow
    You can start with the workflow templates that we provide, and then you can customize them to your project’s exact requirements.
  4. Once you’ve chosen your workflow, press the “start commit” button
    Your workflow configuration lives in your repository, so the build definition is versioned alongside the finished code.

GitHub Actions guide: https://help.github.com/en/actions
Questions and answers on GitHub Actions: github.community

Git is the free and open source distributed version control system that's responsible for everything GitHub related that happens locally on your computer. This cheat sheet features the most important and commonly used Git commands for easy reference. INSTALLATION & GUIS With platform specific installers for Git, GitHub also provides the. GNU-Octave cheat sheet. Contribute to davidkhala/octave-cheat-sheet development by creating an account on GitHub.

Helpful terms to know

Action
A program that becomes a reusable component to be used in workflows. Actions can install software for the environment, set up authentication, or automate complex sets of tasks. You can find actions in the GitHub Marketplace, or create your own and share them with your community.

Workflow
A configurable, automated process that you can use in your repository to build, test, package, release, or deploy your project. Workflows are made up of one or more “jobs” and can be triggered by GitHub events.

Continuous integration (CI)
The software development practice of frequently committing small code changes to a shared repository. With GitHub Actions, you can create custom CI workflows that automatically build and test your code. From your repository, you can view the status of your code changes and detailed logs for each action in your workflow. CI saves developers time by providing immediate feedback on code changes to detect and resolve bugs faster.

Sheet

YAML
YAML stands for “Yet Another Markup Language”. It’s a human-readable markup language commonly used for configuration files, especially by CI- and DevOps-focused software tools. GitHub Actions uses YAML as the basis of its configuration workflows.

Workflow file
The configuration file that defines your GitHub Actions workflow. This is written in YAML and lives inside your GitHub repository in the .github/workflows directory. Each file in that directory that is named with a .yaml extension will define a unique workflow.

Example workflow file

Cheat

An explanation of this example workflow:

name
The name of your workflow will be displayed on your repository’s actions page.

on
The events that occur on GitHub that will cause your workflow to be executed. For example, you can run your workflow on push and pull_request triggers, which will let you build your code and run your tests in a Continuous Integration workflow. You can add additional constraints on these triggers, like running when certain files or changed or when a certain branch is pushed to.

jobs
A list of the jobs that run as part of the workflow. Each job will run independently of the others, and will run on a different virtual environment. Jobs may have a name to make them easily identifiable in the UI or in logs. Jobs contain a set of steps that will be executed, in order. This workflow has a single job, the build job.

jobs.<job-id>.runs-on
The type of runner to use to run the given job on, either a runner provided by GitHub or a self-hosted runner that you configure. GitHub provides three main types of runners: Linux (named ubuntu-latest), Windows (named windows-latest) and macOS (named macos-latest).

jobs.<job-id>.steps
A list of the steps that will run as part of the job. Each step will run one after another, all on the same virtual environment. By default, if any step fails then the entire job will stop. In this workflow, the build job contains three steps:

  1. The first step uses an action named actions/checkout@v2. This is an action provided by GitHub that will check out your repository onto the runner, so that it can be built and tested.
  2. The second step uses an action named actions/setup-node@v1. This is an action provided by GitHub that will set up a particular version of Node.js on the runner. Arguments can be provided to the action in the with section; in this example, the node-version argument is set to 12, which instructs the action to put Node.js version 12 in the PATH for subsequent steps.
  3. The final step runs programs on the command-line. By default, these programs will be run with bash (on Linux and macOS) or PowerShell (on Windows). A single command may be specified, or multiple commands can be specified by starting them with a leading pipe (|) symbol.
    In this case, a Node.js continuous integration build will be performed by running npm ci to download and install packages from the npm registry, then running npm run build to run the build script specified by the project, and finally running npm test to run any unit tests in the project.
See all whitepapers →

Cheat sheets can be really helpful when you’re trying a set of exercises related to a specific topic, or working on a project. Because you can only fit so much information on a single sheet of paper, most cheat sheets are a simple listing of syntax rules. This set of cheat sheets aims to remind you of syntax rules, but also remind you of important concepts as well. You can click here and download all of the original sheets in a single document.

A more recently updated version of these sheets (April 2021) is available through Leanpub. The updated version includes a sheet that focuses on Git basics, a printer-friendly b&w version of each sheet, and each sheet as a separate document. There is an option to download the fully updated set at no cost.

If you’d like to know when more resources become available, you can sign up for email notifications here.

Overview Sheet

  • Beginner’s Python Cheat Sheet
    • Provides an overview of the basics of Python including variables, lists, dictionaries, functions, classes, and more.

Python Basics

  • Beginner’s Python Cheat Sheet - Lists
    • Focuses on lists: how to build and modify a list, access elements from a list, and loop through the values in a list. Also covers numerical lists, list comprehensions, tuples, and more.
  • Beginner’s Python Cheat Sheet - Dictionaries
    • Focuses on dictionaries: how to build and modify a dictionary, access the information in a dictionary, and loop through dictionaries in a variety of ways. Includes sections on nesting lists and dictionaries, using dictionary comprehensions, and more.
  • Beginner’s Python Cheat Sheet - If Statements and While Loops
    • Focuses on if statements and while loops: how to write conditional tests with strings and numerical data, how to write simple and complex if statements, and how to accept user input. Also covers a variety of approaches to using while loops.
  • Beginner’s Python Cheat Sheet - Functions
    • Focuses on functions: how to define a function and how to pass information to a function. Covers positional and keyword arguments, return values, passing lists, using modules, and more
  • Beginner’s Python Cheat Sheet - Classes
    • Focuses on classes: how to define and use a class. Covers attributes and methods, inheritance and importing, and more.
  • Beginner’s Python Cheat Sheet - Files and Exceptions
    • Focuses on working with files, and using exceptions to handle errors that might arise as your programs run. Covers reading and writing to files, try-except-else blocks, and storing data using the json module.
  • Beginner’s Python Cheat Sheet - Testing Your Code
    • Focuses on unit tests and test cases. How to test a function, and how to test a class.

Project-Focused Sheets

  • Beginner’s Python Cheat Sheet - Pygame
    • Focuses on creating games with Pygame. Creating a game window, rect objects, images, responding to keyboard and mouse input, groups, detecting collisions between game elements, and rendering text
  • Beginner’s Python Cheat Sheet - Matplotlib
    • Focuses on creating visualizations with Matplotlib. Making line graphs and scatter plots, customizing plots, making multiple plots, and working with time-based data.
  • Beginner’s Python Cheat Sheet - Plotly
    • Focuses on creating visualizations with Plotly. Making line graphs, scatter plots, and bar graphs, styling plots, making multiple plots, and working with geographical datasets.
  • Beginner’s Python Cheat Sheet - Django
    • Focuses on creating web apps with Django. Installing Django and starting a project, working with models, building a home page, using templates, using data, and making user accounts.

If you find any errors, please feel free to get in touch:

Email: ehmatthes@gmail.com

Using Github For Documentation

Twitter: @ehmatthes





Comments are closed.