From 4f0d7e17082ab69116279ee6ba4c5c22cb934b40 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Sat, 7 Jan 2023 22:18:21 +0800 Subject: [PATCH] chore(shell-aliases): migrate from dotfiles-legacy * Changed shebang to regular sh for possible POSIX compatibility * Updated header notes, probably add SPDX-License-Identifier later Signed-off-by: Andrei Jiroh Halili --- .config/aliases | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ .profile | 2 ++ 2 files changed, 74 insertions(+) create mode 100644 .config/aliases diff --git a/.config/aliases b/.config/aliases new file mode 100644 index 0000000..6a25d4d --- /dev/null +++ b/.config/aliases @@ -0,0 +1,72 @@ +#!/bin/env sh + +# Aliases across shells. Note that this is only tested on Bash and Zsh, with a bit of testing +# on ash. + +# basic git commands +alias clone="git clone" +alias stats="git status" +## shortcuts to creating commits +alias commit="git commit --signoff --gpg-sign" +alias commit-nogpg="git commit --signoff --no-gpg-sign" +alias new-checkpoint="commit" +alias new-checkpoint-nogpg="commit-nogpg" +## shortcuts to creating tags +alias tag-checkpoint="git tag --gpg-sign" +alias tag-checkpoint-nogpg="git tag --no-gpg-sign" +alias new-tag="tag-checkpoint" +alias new-tag-nogpg="tag-checkpoint-nogpg" +## shortcuts to managing yiff stash +alias stash="git stash push --keep-index" +alias pop-stash="git stash pop" +alias apply-stash="git stash apply" +alias yeet-stash="git stash drop" +## staging stuff +alias stage="git add" +alias unstage="git restore --staged" +alias nuke-from-index="git rm" + +# branch management +alias rename-branch="git branch -m" +alias set-upstream-remote="git branch -u" + +# remote management +alias change-origin="git remote set-url origin" +alias change-upstream="git remote set-url upstream" +alias add-remote="git remote add" +alias change-remote-url="git remote set-url" +alias nuke-remote="git remote remove" +alias remove-remote="nuke-remote" + +# git push +alias push="git push" +## add main:master since Git assumes local branch to +## remote branch when running this alias +alias deploy-divio="git push divio" + +# fetch / pull +alias fetch="git fetch --all" +## depending on remote branch at upstream, +## assumes its same branch. +alias pull-upstream="fetch && git pull upstream" +alias pull-origin="fetch && git pull origin" + +# history-cleanup like scripts +alias clean-shellhis="history -c && clear" + +# test SSH connections +alias test-gh-ssh="ssh -p 22 git@github.com" +alias test-gl-ssh="ssh -p 22 git@gitlab.com" + +# ssh-agent stuff +## quock shortcut into add-ssh-keys stuff +#alias add-ssh-key="$HOME/.dotfiles/bin/add-ssh-keys" + +# shortcuts to some functions +alias edit-script="edit-script-file" + +# add a bit of test here +alias guild-test="echo successfully imported owo" + +# shortcuts for rdp stuff +alias bshq-cursed='rdesktop --user cursed-remote-user -r audio:local -x lan -r clipboard:PRIMARYCLIPBOARD -n guildedguy bullshit.hq' diff --git a/.profile b/.profile index eb3e878..02a37ba 100644 --- a/.profile +++ b/.profile @@ -1,3 +1,4 @@ +#!/usr/bin/env sh # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists @@ -7,3 +8,4 @@ if [ -n "$BASH_VERSION" ]; then fi source "$HOME/.env" +source "$HOME/.config/aliases"