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
var jwtPrivateKey = `-----BEGIN RSA PRIVATE KEY----- | |
... | |
-----END RSA PRIVATE KEY-----`; | |
// Set headers for JWT | |
var header = { | |
'alg': 'RS256', | |
'typ': 'JWT' | |
}; |
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 remote add -f Bproject /path/to/B | |
git merge -s ours --no-commit Bproject/master | |
git read-tree --prefix=dir-B/ -u Bproject/master | |
git commit -m "Merge B project as our subdirectory" | |
git pull -s subtree Bproject master |
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 clone --bare [email protected]:{USERNAME}/{REPOSITORY_NAME}.git | |
cd {REPOSITORY_NAME}.git | |
git push --mirror [email protected]:my-new-repo.git | |
cd .. | |
rm -rf {REPOSITORY_NAME}.git |
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
# load ssh key | |
keyloaded=$(ssh-add -l|grep aroemen -c) | |
if [ $keyloaded == '0' ] | |
then | |
ssh-add {path to ssh key} | |
fi |
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
#!/bin/sh | |
set -e | |
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | | |
while read path_key path | |
do | |
url_key=$(echo $path_key | sed 's/\.path/.url/') | |
url=$(git config -f .gitmodules --get "$url_key") | |
git submodule add $url $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 branch -d `git branch --merged | grep -v '^*' | tr -d '\n'` |
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
#!/bin/bash | |
mv .gitattributes .gitattributes-tmp | |
git add -u | |
mv .gitattributes-tmp .gitattributes | |
git reset .gitattributes | |
git checkout -- .gitattributes |
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
mv foo foo2 | |
git add -A | |
git commit -m "renaming" | |
mv foo2 FOO | |
git add -A | |
git commit --amend -m "renamed foo to FOO" | |
# or in git v1.7.7+ | |
git mv improper_Case improve_case2 | |
git mv improper_case2 improve_case |