Skip to content

Instantly share code, notes, and snippets.

View benjaminlukeclark's full-sized avatar
:octocat:

Benjamin Clark benjaminlukeclark

:octocat:
View GitHub Profile
@sbolel
sbolel / sign-previous-commits.md
Created June 21, 2023 16:48
How to sign previous commits in a PR

To sign all your commits in the Git Pull Request (PR), you can use a combination of git rebase and git commit --amend. Here are the steps:

  1. Before starting, make sure you've configured Git to use your signing key. You can do this with:

    git config --global user.signingkey YOUR_SIGNING_KEY
    git config --global commit.gpgsign true

    Replace YOUR_SIGNING_KEY with your GPG key ID.

  2. Then you need to start an interactive rebase with the parent of your first commit. If you don't know what commit that is, you can use git log to display your commit history. Once you have your commit hash, start the rebase:

@luismts
luismts / GitCommitBestPractices.md
Last active October 17, 2025 16:37
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@alexpaul
alexpaul / Bash.md
Last active February 9, 2025 02:05
Creating a Bash Profile

Bash

What is a bash_profile

There is a hidden file in your Mac’s user directory named .bash_profile. This file is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command line interface. Within it you can change your terminal prompt, change the colors of text, add aliases to functions you use all the time, and so much more.

Creating a .bash_profile

If you run the open ~/.bash_profile command and do not have a current .bash_profile, follow these steps to create one:

  1. Open Terminal