Skip to content

Instantly share code, notes, and snippets.

@meadowsys
Last active November 25, 2020 03:20
Show Gist options
  • Save meadowsys/3cb00f1bdb8b39eacc0f71d4be7596a8 to your computer and use it in GitHub Desktop.
Save meadowsys/3cb00f1bdb8b39eacc0f71d4be7596a8 to your computer and use it in GitHub Desktop.

gitsz

random git things that i use a lot (but forget a lot), and this is a reference for me (lol)

checkout orphan

git checkout --orphan branchname
git rm -rf .

tagz

lightweight:

git tag v0.18.0

annotated:

git tag -a v0.18.0 -m "my tag message thing here"

lightweight tag later

git tag v0.18.0 40f8746df26d754984e4c92898d751566bc8d0d6

annotated tag later

git tag -a v0.18.0 40f8746df26d754984e4c92898d751566bc8d0d6

push tags

git push origin --tags

show tag data (annotated):

git show v0.18.0

delete tag

git tag -d v0.18.0

delete remote tag

git push origin --delete v0.18.0

checkout tag

git checkout v0.18.0

checkout tag new branch

git checkout -b newbranch v0.18.0

verify signed commit

git verify-commit shashashashashashashasha

checkout pr branch

git fetch origin pull/<ID, like #255>/head:<Branchname>
git checkout <Branchname>
# or just use gh cli lol
# dont do this there are better methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment