Skip to content

Instantly share code, notes, and snippets.

View lzkill's full-sized avatar

Luiz Kill lzkill

  • Vitória/Brasil
View GitHub Profile
@lzkill
lzkill / post-vars.sh
Created December 21, 2021 10:01
Create env vars on a GitLab project reading from a file
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-u] [-e environment] -f env_file -t gitlab_target_url -T gitlab_access_token
@lzkill
lzkill / gclear.sh
Last active January 19, 2023 11:25
Clear git history
#!/bin/bash
default_branch=`basename $(git symbolic-ref --short refs/remotes/origin/HEAD)`
git checkout --orphan tmp
git add -A
git commit -m "first commit"
git branch -D $default_branch
git branch -m $default_branch
git push -f --set-upstream origin $default_branch