Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 750 Bytes

git.md

File metadata and controls

36 lines (25 loc) · 750 Bytes

GIT

GIT things.

Commands

Deleting multiple local branches:

git branch | grep "<pattern>" | xargs git branch -D

Forks

Tracking an upstream fork:

git remote add upstream [email protected]:VENDOR/PROJECT.git
git fetch upstream
git checkout --track upstream/BRANCH_NAME

Sources:

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork

Checking out branches from forks

git fetch origin pull/3/head:my_new_branch
git checkout my_new_branch

Source: https://stackoverflow.com/questions/62432498/how-do-i-checkout-a-pr-from-a-fork