From http://www.darkcoding.net/software/cleaning-up-old-git-branches/
-
Switch to the main branch, usually 'develop':
git checkout develop -
Get a list of fully merged branches:
| ### Keybase proof | |
| I hereby claim: | |
| * I am antomor on github. | |
| * I am antomor (https://keybase.io/antomor) on keybase. | |
| * I have a public key ASAqCORrGLqvIB19KgjNK9Y22DCpEl2r-fS4IYh_1zmcago | |
| To claim this, I am signing this object: |
| { | |
| "name": "franklin-contracts", | |
| "version": "0.1.0", | |
| "license": "MIT", | |
| "devDependencies": { | |
| "@nomiclabs/hardhat-ethers": "^2.0.0", | |
| "@nomiclabs/hardhat-etherscan": "^2.1.0", | |
| "@nomiclabs/hardhat-solpp": "^2.0.0", | |
| "@nomiclabs/hardhat-waffle": "^2.0.0", | |
| "@typechain/ethers-v5": "^3.0.0", |
From http://www.darkcoding.net/software/cleaning-up-old-git-branches/
Switch to the main branch, usually 'develop':
git checkout develop
Get a list of fully merged branches:
| {"id": "4be19430264ba409f67d318897b61a6134220d8781885bf13516e0a10414c3dc94dd61d7df835881982215e53e9776490e1dfcec697f4f8a3d030fac95abe23a"} |
| # from https://stackoverflow.com/a/30352360/6816965 | |
| # 1. clone the publish repo and push it into the private one | |
| git clone --bare https://github.com/exampleuser/public-repo.git | |
| cd public-repo.git | |
| git push --mirror https://github.com/yourname/private-repo.git | |
| cd .. | |
| rm -rf public-repo.git | |
| # 2. work on the private repository as usual |
| git merge --no-commit --no-ff <BRANCH-TO-MERGE> | |
| echo $? | |
| git merge --abort |
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| ### OPTION 1 ########################################################################################### | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # |
| # Mac/Linux | |
| find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; | |
| # Windows | |
| FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d" |
| class TenIntegers: | |
| def __init__(self, start_from=0): | |
| self.current=start_from | |
| self.max = self.current + 10 | |
| def __iter__(self): | |
| ''' | |
| This method makes the object iterable | |
| ''' |
| const wait = (milliSeconds) => { | |
| return new Promise((resolve) => setTimeout(() => resolve(), milliSeconds)); | |
| }; | |
| const retry = ({fn, maxRetries, initialDelayMs, intervalMs}) => { | |
| // first attempt after the initial delay | |
| let attempts = wait(initialDelayMs); | |
| if ( maxRetries > 0) { | |
| attempts = attempts.then(() => fn()); | |
| } |