mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
git set upstream shortcut
This commit is contained in:
parent
e64832cdf5
commit
c25c996061
12
bin/git_set_upstream
Normal file
12
bin/git_set_upstream
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
function git_branch_name {
|
||||||
|
val=`git branch 2>/dev/null | grep '^*' | colrm 1 2`
|
||||||
|
echo "$val"
|
||||||
|
}
|
||||||
|
|
||||||
|
git push --set-upstream origin $(git_branch_name)
|
@ -18,6 +18,7 @@ function aliases --description 'All aliases'
|
|||||||
abbr -a gc 'git commit -m'
|
abbr -a gc 'git commit -m'
|
||||||
abbr -a gu 'git pull'
|
abbr -a gu 'git pull'
|
||||||
abbr -a gp 'git push'
|
abbr -a gp 'git push'
|
||||||
|
abbr -a gpp 'git_set_upstream'
|
||||||
abbr -a gl 'git log --graph --decorate --oneline -20'
|
abbr -a gl 'git log --graph --decorate --oneline -20'
|
||||||
abbr -a gll 'git log --graph --decorate --oneline'
|
abbr -a gll 'git log --graph --decorate --oneline'
|
||||||
abbr -a gco 'git checkout'
|
abbr -a gco 'git checkout'
|
||||||
|
Loading…
Reference in New Issue
Block a user