-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
git で現在のローカルブランチの内容をリモートの同名ブランチに pull & push する方法のメモ。 | ||
|
||
--- | ||
|
||
## コマンドの調査 | ||
|
||
Git の CUI 操作は苦ではないが、ブランチ名を毎回入力するのは時間がかかるのでブランチ名を入力しなくて済むコマンドを調べた | ||
|
||
```sh | ||
# pull | ||
git pull origin $(git branch --show-current) | ||
|
||
# push | ||
git push origin HEAD | ||
``` | ||
|
||
このまま使うと長いので、alias を設定した。fish の設定例。 | ||
|
||
```config | ||
abbr --add gpb 'git pull origin $(git branch --show-current)' | ||
abbr --add gph 'git push origin HEAD' | ||
``` | ||
|
||
## `abbr` について | ||
|
||
abbr を設定したことがなかったのでメモ | ||
|
||
- abbr は abbreviations(略語という意味)の省略語 | ||
- Enter キーやスペースキーで元のコマンドが展開されるので、`history` でコマンドの実行履歴を見た時に git などで検索しやすい | ||
|
||
[https://fishshell.com/docs/current/cmds/abbr.html](https://fishshell.com/docs/current/cmds/abbr.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters