Last active
July 26, 2023 10:57
-
-
Save Aissaoui-Ahmed/bd2429bb51b299f746f847eb8815e156 to your computer and use it in GitHub Desktop.
git alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = "!f() { git stash; git checkout \"$@\"; git stash pop; }; f" | |
cob = "!f() { git stash; git checkout -b \"$@\"; git stash pop; }; f" | |
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate | |
done = !git push origin HEAD | |
pll= !git pull origin HEAD | |
lg = !git log --name-only --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\" --abbrev-commit -30 | |
undo = reset HEAD~1 --mixed | |
del = branch -D | |
s = status | |
ignore= "!sh ~/ignore.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
lang=$1 | |
if [ ! -n "${lang##+([[:space:]])}" ]; then | |
echo 'Please add programming language' | |
fi | |
langUpperCase=$(echo $lang |sed 's/./\u&/') | |
curl -s "https://raw.githubusercontent.com/github/gitignore/main/${langUpperCase}.gitignore" --output .gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment