Project

General

Profile

Common git operations » History » Version 10

« Previous - Version 10/18 (diff) - Next » - Current version
cryptogopher, 2020-07-10 02:29


Common git operations

Prerequisites:

cd ~/plugins/issue_recurring

Issue resolution in separate branch

Create separate branch for issue

  1. Checkout and update master:
    $ git checkout master
    $ git pull
    
  2. 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
    
  3. Reload all files open in vim:
    :bufdo! e
    

Merge issue branch into master

  1. Push uncommited changes on issue branch.
  2. Checkout and update master:
    $ git checkout master
    $ git pull
    
  3. Merge adding comment closes #N and push issueN branch:
    $ git merge issueN
    $ git push
    
  4. Delete merged branch from local and remote:
    $ git branch -d issueN
    $ git push origin :issueN
    
  5. Verify:
    $ git branch -a
    

Pull requests

Checkout pull request locally (for editing, testing etc.)

Release

Move tag to different commit (e.g. after fixing some mistake)

  1. Remove tag from remote (if it has been pushed):
    git push origin :refs/tags/1.3
    
  2. Force replacement of existing tag with one referencing most recent commit:
    git tag -fa 1.3
    
  3. Push:
    git push origin 1.3
    

Also available in: PDF HTML TXT