Skip to content

Instantly share code, notes, and snippets.

@zaprogrammer
Last active December 18, 2019 10:41
Show Gist options
  • Save zaprogrammer/2b0b55d2fb4365f21b8c562b527f055d to your computer and use it in GitHub Desktop.
Save zaprogrammer/2b0b55d2fb4365f21b8c562b527f055d to your computer and use it in GitHub Desktop.
[Git snippets] Useful git snippets for everyday work. #Git #SSL
# List current ssl files seen to this scope
ssh-add -l
# Adds required rsa file to current terminal
ssh-add /Users/ahmedelshaabany/.ssh/id_rsa
git log --pretty=oneline v16.1.3..HEAD | grep -o -i -e "SAV-[[:digit:]]*" | sort -u
renamed branch "master" to "master-old" and use commit ba2f9cc as new "master"
-- this is done by doing a merge commit with "ours" strategy which obsoletes
the branch.
these are the steps I did:
# rename the branch "master" to "master-old"
# this works even if you are on branch "master"
git branch -m master master-old
# create master from new starting point
git branch master ba2f9cc
# now we've got to fix the new branch...
git checkout master
# ... by doing a merge commit that obsoletes
# "master-old" hence the "ours" strategy.
git merge -s ours master-old
#Last step, push to remote master, use: git push -f to force push if required
git push origin master
#Remove a tag
git tag -d v16.2.5
git push origin :refs/tags/v16.2.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment