This file contains hidden or 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
| # shortform git commands | |
| alias g='git' | |
| # get a list of all commit messages for a repo | |
| git log --pretty=format:'%s' | |
| # find the nearest parent branch of the current git branch | |
| git show-branch -a | grep '\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' | |
| # push changes to an empty git repository for the first time |
This file contains hidden or 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
| cd ~/workspace/laminas | |
| # clone | |
| gh repo list laminas --limit 999 --no-archived --json nameWithOwner --jq '.[]|.nameWithOwner' | xargs -I {} bash -c '[ ! -d $(basename {}) ] && echo -e "\n{}" && gh repo clone {} && (cd $(basename {}) && gh repo set-default {} && gh repo fork --remote)' | |
| # checkout moving default branch | |
| for repo in *; do (cd "${repo}" && echo -e "\n${repo}" && git fetch upstream && git remote set-head --auto upstream && git checkout --force $(git rev-parse --abbrev-ref upstream/HEAD | cut -d/ -f2-)); done | |
| # pull changes for checked out branch | |
| for repo in *; do (cd "${repo}" && echo -e "\n${repo}" && git pull upstream --ff-only); done |
OlderNewer