h1. Common git operations {{>toc}} Prerequisites:
cd ~/plugins/issue_recurring
h2. Issue/pull request resolution in separate branch h3. Create separate branch for issue # Checkout and update master:
$ git checkout master
$ git pull
# Create, checkout new branch and push it to remote (so it will be tracked and replicated on it.michalczyk.pro):
$ git checkout -b issueN
$ git push -u origin issueN
# Reload all files open in vim:
:bufdo! e
h3. Checkout pull request locally (for editing, testing etc.) "Github docs":https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally#modifying-an-inactive-pull-request-locally # Fetch pull request based on its number into new branch and switch to new branch:
$ git fetch origin pull/N/head:prN
$ git checkout prN
# (optionally) Push newly created branch:
git push -u origin prN
h3. Merge issue/pull request branch into master # Push uncommited changes on issue branch. # Checkout and update master:
$ git checkout master
$ git pull
# Merge adding comment _closes #N_ (for issue branch), optionally view commits and push issueN/prN branch:
$ git merge issueN
$ git log origin/master..HEAD
$ git push
# Delete merged branch from local and remote:
$ git branch -d issueN
$ git push origin :issueN
# Verify:
$ git branch -a
h2. Release h3. Move tag to different commit (e.g. after fixing some mistake) # Remove tag from remote (if it has been pushed):
git push origin :refs/tags/1.3
# Force replacement of existing tag with one referencing most recent commit:
git tag -fa 1.3
# Push:
git push origin 1.3
h2. Other h3. Change remote URL from HTTPS to SSH (required by Github's no-password policy) # Check current URL:
git remote -v
# Change to SSH:
git remote set-url origin git@github.com:cryptogopher/issue_recurring.git