push current-branch to remote
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
LICENSE
README.md

README.md

git-pub

push current-branch to remote

git commit -m "some changes"

git pub

# pull request ...
# and merged

git purge
Table of Contents

Requirements

  • GNU bash, version 4.3.48(1)-release (x86_64-alpine-linux-musl)
  • git version 2.14.2

Usage

to install git-pub, clone into your bash-scripts directory, and export PATH

INSTALL_DIR=path/to/scripts/git-pub

git clone https://github.com/getto-systems/git-pub.git $INSTALL_DIR

export PATH=$INSTALL_DIR/bin:$PATH

git pub

push current-branch to remote that named 'pub'

git pub #=> git push pub <CURRENT_BRANCH>

git purge

cleanup current-branch from remote and local

git purge #=>
  git push pub :<CURRENT_BRANCH> &&
  git branch -d <PARENT_BRANCH> &&
  git branch <PARENT_BRANCH> origin/<PARENT_BRANCH> &&
  git checkout <PARENT_BRANCH> &&
  git branch -d <CURRENT_BRANCH> &&
  git pub
  • CURRENT_BRANCH : working branch name
  • PARENT_BRANCH : base branch of working branch
  1. delete pub's current-branch
  2. renew parent-branch : delete local, and create from origin
  3. checkout parent-branch
  4. delete local current-branch
  5. push pub

git parent

detect base branch of current-branch

git checkout master
git checkout -b branch-A
git commit -m "some changes"

git parent # => master
git checkout master
git checkout -b branch-A
git commit -m "some changes"
git checkout -b branch-B
git commit -m "some changes"

git parent # => branch-A

git reg-pub

register remote that named 'pub'

git reg-pub github:GITHUB_USER bitbucket:BITBUCKET_USER #=>
  git remote add pub $URL

git delete-pub

delete current-branch from remote that named 'pub'

git delete-pub #=> git push pub :<CURRENT_BRANCH>

License

git-pub is licensed under the MIT license.

Copyright © since 2016 shun.fix9@gmail.com