You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Fetch a github pull request from <remote> and check it out locally in a branch named <remote>-pr-<pr number>
function gitpr ()
{
if [ -z "$2" ]; then
echo "Usage: gitpr <remote> <pr number>"
else
git fetch $1 pull/$2/head:$1-pr-$2 && git checkout $1-pr-$2
fi
}
# You are on a feature branch which has been merged upstream, so checkout master, blast the old branch and sync up.
function gitpr-done ()
{
cb=$(git rev-parse --abbrev-ref HEAD) # parse the ID of the current branch
git checkout master
git branch -D ${cb}
git pull --ff-only upstream master && git push origin master --no-verify
}
in der
.bashrc
oder als alias, über id PR id:
git config --global --add alias.pr '!f() { git fetch -fu ${2:-upstream} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f'
git config --global --add alias.pr-clean '!git checkout master ; git for-each-ref refs/heads/pr/* --format="%(refname)" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done'
Pull ein Pull Request:
git pr <id>
Alle PRs löschen, die mit
git pr ..
angelegt wurden:git pr-clean
The text was updated successfully, but these errors were encountered: