Actions
Common git operations » History » Revision 11
« Previous |
Revision 11/18
(diff)
| Next »
cryptogopher, 2020-07-10 02:31
Common git operations¶
- Table of contents
- Common git operations
Prerequisites:
cd ~/plugins/issue_recurring
Issue resolution in separate branch¶
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
Merge issue branch into master¶
- Push uncommited changes on issue branch.
- Checkout and update master:
$ git checkout master $ git pull
- Merge adding comment closes #N and push issueN branch:
$ git merge issueN $ git push
- Delete merged branch from local and remote:
$ git branch -d issueN $ git push origin :issueN
- Verify:
$ git branch -a
Pull requests¶
Checkout pull request locally (for editing, testing etc.)¶
- 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
Release¶
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
Updated by cryptogopher over 4 years ago · 11 revisions