Skip to the content.

Git Cheatsheet

Good Cheatsheet

Table Of Contents

Git Commands

git help <command>: Show help for a command.

Config

Stage and Commit

Branch

Tag

Signing

pgp: pretty good privacy

gpg: gnu privacy guard

Blame

Bisect

Debugging tool to find the commit that introduced a bug.

bisect: binary search commit history

Github Workflows

A workflow is a configurable automated process made up of one or more jobs. You must create a workflow file to use the workflow. The file must be located in the .github/workflows directory of your repository.

A sample workflow file:

# This workflow will install Python dependencies and run tests.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Unit Tests

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: "3.10"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install pipenv

      - name: Run tests
        run: pipenv run test

Handwrite Notes

How to undo the last commit?

How to undo the reset?