Skip to content

Instantly share code, notes, and snippets.

View linuxbandit's full-sized avatar

linuxbandit

  • Sofia
View GitHub Profile
@rponte
rponte / get-latest-tag-on-git.sh
Last active October 17, 2024 20:03
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@andykuszyk
andykuszyk / Useful Git Hooks.md
Last active April 19, 2017 20:52
Useful Git Hooks

#Useful Git Hooks

Below are a couple of simple git hooks that can be useful for controlling and formatting commits. These are generally re-hashes of other people's ideas, so I've credited these as appropriate.

Git Hooks

A git hook is a script that lives in your .git/hooks directory. The scripts are invoked when certain events occur within your repo, such as make a commit or pushing changes. Hooks can be used to automate and augment basic actions within your repos.

##Include an issue number in your commit message To amend your commit messages after they have been submitted, you'll need a commit-msg hook. I borrowed most of these ideas from @monkseal. This hook assumes that your issue numbers are formatted into you branch names in a way that you can extract using a regex.

@mauromarano
mauromarano / desktop_organizer.sh
Last active August 2, 2021 13:18
Script per tenere organizzato il desktop
#!/bin/bash
###########################################################################
# AUTHOR: Mauro Marano
# SITE: mauromarano.it/com
# Questo script serve per tenere organizzato il desktop
# Una volta impostate le variabili lui andrà a creare delle cartelle
# Per ogni tipo di file specificato.
# La cosa migliore è farlo girare con un cronjob.
# crontab -e
@gadiener
gadiener / cluster_export.sh
Last active June 8, 2021 08:47
Script to get all the resources yaml file from the Kubernetes context
#!/bin/bash
# How to run: `./backup_cluster.sh | tee export-$(date +%s).log`
set -e
if [ -n "${DEBUG}" ]; then
set -x
fi