Last active
September 9, 2021 12:37
-
-
Save nopeless/11e0c72b8546003aed2da44de4b96d38 to your computer and use it in GitHub Desktop.
Git snippets
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
# basics | |
# oh frik the commit message was wrong | |
git commit -a --amend -m "new message" | |
# or | |
git commit -a --amend --no-edit | |
# set remote | |
git remote set-url origin url | |
# other stuff | |
# git rebase (rebase is op dont forget the -i and remember to set the text editor to npp or a text editor that is light) | |
git rebase -i SHA^ | |
# use this when testing github actions | |
git commit -a --amend --no-edit && git push -f | |
# reflogs | |
# show list | |
git reflog | |
# reset to specific point | |
git reset HEAD@{<number>} | |
# for powershell, use | |
git reset "HEAD@{<number>}" | |
# pretty tree | |
git log --graph --pretty=oneline --abbrev-commit | |
# pretty tree w other branches | |
git log --graph --pretty=oneline --abbrev-commit --all | |
# show other branches as well | |
git log --all | |
# tagging | |
# show current tag | |
git tag --points-at HEAD | |
# create tag | |
git tag <tag> | |
# tag with annotation | |
git tag -a <tag> -m <message> | |
# delete | |
git tag -d | |
# push with tag | |
git push origin : <tag> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment