Last active
May 19, 2021 10:21
-
-
Save ipatalas/39c0f78d5ddfddae2c828170eaae427e to your computer and use it in GitHub Desktop.
Git helpers
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] | |
# clean all local branches that no longer have an existing remote | |
clean-local = "!git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D" | |
# show all ignored (--assume-unchanged) files | |
ignored = "!git ls-files -v | grep '^[[:lower:]]'" | |
ignore = update-index --assume-unchanged | |
unignore = update-index --no-assume-unchanged | |
s = switch | |
new-feature = "!f() { git checkout -b feature/$1 --no-track origin/develop; }; f" | |
new-bugfix = "!f() { git checkout -b bugfix/$1 --no-track origin/develop; }; f" | |
ci = commit -m | |
[pager] | |
log = false | |
show = false | |
config = false |
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
:: Refresh forked repo | |
git remote add upstream <original_repo> | |
git fetch upstream | |
git merge upstream/master | |
:: Create branch from other branch | |
git checkout -b <new_branch> --no-track origin/<original_branch> | |
:: Find a deleted file | |
git log --diff-filter=D --summary | grep delete | |
git log --all -- FILEPATH | |
git show COMMIT_ID -- FILE_PATH |
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
; **git-specific | |
#If WinActive("cmd") or WinActive("MINGW64") | |
::gc::git commit | |
::gch::git checkout | |
::gr::git rebase -i | |
::grc::git rebase --continue | |
::gra::git rebase --abort | |
::grh::git reset --hard | |
::gb::git branch | |
::gst::git stash | |
::ga::git add -p | |
::gai::git add -i | |
::gm::git merge origin/ | |
::gignore::git update-index --assume-unchanged | |
::gunignore::git update-index --no-assume-unchanged | |
::gnb::git checkout -b --no-track origin/development{left 30} | |
#If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment