Subscribed unsubscribe Subscribe Subscribe

oinume journal

Scratchpad of what I learned

Sending pull-request only with terminal and keyboard

Git in English

Requirements

  • Mac
  • Terminal
  • hub command (brew install hub)

How to send pull-request

Make a new branch.

$ git checkout -b new-cool-feature

Editing source code and commit.

$ git commit -a

Push to remote and copy correct git push command into clipboard.

$ git push 2>&1 | grep git | pbcopy

Paste clipboard into terminal.

$ git push --set-upstream origin new-cool-feature

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 324 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@github.com:example/example-project.git
 * [new branch]      new-cool-feature -> new-cool-feature
Branch new-cool-feature set up to track remote branch new-cool-feature from origin.

Send pull-request by hub.

$ hub pull-request
https://github.com/example/example-project/pull/1