From 0b2e36f3e742b469af9cdc26ea6f725b217ae4cb Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Wed, 13 Jul 2016 15:02:04 +0200 Subject: [PATCH] many git and repo aliases --- custom/plugins/buildbot_dev/buildbot_dev.plugin.zsh | 1 + custom/plugins/intel-repo/intel-repo.plugin.zsh | 3 +++ dot_files/gitconfig | 10 ++++++++++ plugins/git2/git2.plugin.zsh | 10 ++++++++-- plugins/repo/repo.plugin.zsh | 3 +++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/custom/plugins/buildbot_dev/buildbot_dev.plugin.zsh b/custom/plugins/buildbot_dev/buildbot_dev.plugin.zsh index 78b991002..06adeabaf 100644 --- a/custom/plugins/buildbot_dev/buildbot_dev.plugin.zsh +++ b/custom/plugins/buildbot_dev/buildbot_dev.plugin.zsh @@ -54,6 +54,7 @@ alias cKcssci='cactus kill ; cactus slaves restart ; cactus info' alias m='make' alias s='subl' +alias a='atom' alias sagiy='sudo apt-get install -y' alias saguysaguy='sudo apt-get update -y ; sudo apt-get upgrade -y' diff --git a/custom/plugins/intel-repo/intel-repo.plugin.zsh b/custom/plugins/intel-repo/intel-repo.plugin.zsh index 758cca190..acfdde5e0 100644 --- a/custom/plugins/intel-repo/intel-repo.plugin.zsh +++ b/custom/plugins/intel-repo/intel-repo.plugin.zsh @@ -16,6 +16,9 @@ alias rsrra.='repo sync .; repo rebase --auto-stash .' alias rsarra.='repo sync -a . ; repo rebase --auto-stash .' compdef _repo rsrra.='repo rebase' +alias gPoHrfm='git push origin HEAD:refs/for/master' +alias git-push-refs-for-master='git push origin HEAD:refs/for/master' + function rsbrsrra() { if [[ -z $1 ]]; then diff --git a/dot_files/gitconfig b/dot_files/gitconfig index 255688be2..5c356dad5 100644 --- a/dot_files/gitconfig +++ b/dot_files/gitconfig @@ -38,6 +38,16 @@ root = rev-parse --show-toplevel parents = show --pretty=%P + # For Git hub - uncomment if you don't have git extras + # + # Easily checkout local copies of pull requests from GitHub remotes: + # + # git pr 4 - creates local branch pr/4 from the origin remote and checks it out + # git pr 4 upstream - creates local branch pr/4 from upstream remote and checks it out + # git pr-clean - removes all pr/* branches from your local repo + # pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" + # pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done" + [core] editor = vim diff --git a/plugins/git2/git2.plugin.zsh b/plugins/git2/git2.plugin.zsh index 12054b0af..b9f7bc184 100644 --- a/plugins/git2/git2.plugin.zsh +++ b/plugins/git2/git2.plugin.zsh @@ -38,6 +38,8 @@ compdef _git gl=git-pull # Git pull and rebase alias gpr='git pull --rebase' compdef _git gpr=git-pull +# Git rebase current master branch against master branch on upstream +alias gprum='git pull --rebase upstream master' ############### # git push (gP) @@ -61,6 +63,10 @@ compdef _git gPd=git-push alias gPf='git push --force' compdef _git gPf=git-push alias gPhm='git push heroku master' +# git push origin +alias gPof='git push origin' +# git push origin force +alias gPof='git push origin --force' ################ # Git Fetch (gf) @@ -238,8 +244,8 @@ compdef _git gwc=git-whatchanged alias gls='git ls-files | grep' compdef _git gls=git-ls-files -alias gpoat='git push origin --all && git push origin --tags' -compdef _git gpoat=git-push +alias gPoat='git push origin --all && git push origin --tags' +compdef _git gPoat=git-push alias gmt='git mergetool --no-prompt' compdef _git gmt=git-mergetool alias gmtvim='git mergetool --no-prompt --tool=vimdiff' diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh index 26ba78e24..c23277688 100644 --- a/plugins/repo/repo.plugin.zsh +++ b/plugins/repo/repo.plugin.zsh @@ -32,6 +32,9 @@ compdef _repo ruc='repo upload' alias yruc='yes | repo upload --cbr .' compdef _repo ruc='repo upload' +alias rucy='yes | repo upload --cbr .' +compdef _repo rucy='repo upload' + # Repo start current branch on all projects alias rscb='echo "Starting branch $(git branch | sed -n "/\* /s///p") on all projects" && repo start $(git branch | sed -n "/\* /s///p") --all' compdef _repo rscb='repo start'