Skip to content

Latest commit

 

History

History
130 lines (79 loc) · 3.12 KB

README.md

File metadata and controls

130 lines (79 loc) · 3.12 KB

git-post

pull request to origin

status: production ready

# some changes
git create-work-branch "add: awesome feature"
  • limitation: only for GitHub, BitBucket, GitLab
Table of Contents

Requirements

Usage

# some changes
git create-work-branch "add: awesome feature

- change awesome
- change another awesome"

This command is short-hand for following commands.

git checkout -b add-awesome-feature &&
git commit -m "add: awesome feature

- change awesome
- change another awesome" &&
git pub &&
git post

setup token

You have not configured access token, git-post prompt to enter your access token.

  • GitHub: create Personal access token (allow public_repo) and enter access token
  • GitLab: add Personal Access Tokens (scope: api) and enter access token
  • BitBucket: create OAuth consumer key (allow create pull request) and enter client_id and secret then access URL, and paste code

feature branch

git create-feature-branch "my awesome feature"

This command is short-hand for following commands.

git checkout -b feature-my-awesome-module &&
git commit -m "my awesome module" &&
git pub &&
git push origin <PARENT_BRANCH>

post pull request

  • title: "subject"
  • description: "subject\n\nbody"
git post "subject

body"

Environment Variables

  • ${GIT_POST_REMOTE_FORK_NAME:=pub} : git post will push local changes to remote that named "pub". If you want to push to another remote, set GIT_POST_REMOTE_FORK_NAME. e.g. GIT_POST_REMOTE_FORK_NAME=origin

GitLab settings

  • $GITLAB_MERGE_REQUEST_ASSIGNEES : git post will assign yourself. If you want to assign other people, set GITLAB_MERGE_REQUEST_ASSIGNEES. e.g. GITLAB_MERGE_REQUEST_ASSIGNEES=getto,shun-fix9
  • $GITLAB_REMOVE_SOURCE_BRANCH : If there is GITLAB_REMOVE_SOURCE_BRANCH, git post create MR with "remove source branch" option.
  • $GITLAB_ACCESS_TOKEN : If there is GITLAB_ACCESS_TOKEN, git post use this token instead of local-saved-token.

post pull request to branch

git post "subject" $branch

Install

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

GIT_POST_INSTALL_PATH=/path/to/install/dir

curl https://raw.githubusercontent.com/getto-systems/git-post/master/bin/setup.sh | bash -s -- $GIT_POST_INSTALL_PATH
export PATH=$PATH:$GIT_POST_INSTALL_PATH/git-post/bin

License

git-post is licensed under the MIT license.

Copyright © since 2016 shun@getto.systems