Last active
December 18, 2019 10:41
-
-
Save zaprogrammer/2b0b55d2fb4365f21b8c562b527f055d to your computer and use it in GitHub Desktop.
[Git snippets] Useful git snippets for everyday work. #Git #SSL
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
# 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 |
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 log --pretty=oneline v16.1.3..HEAD | grep -o -i -e "SAV-[[:digit:]]*" | sort -u |
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 reset --hard HEAD@{1} |
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment