Add more git helper functions for diffing branches
This commit is contained in:
parent
9daf9b2a42
commit
60411b9c7f
|
@ -47,8 +47,8 @@ alias ll='ls -lh'
|
|||
alias la='ls -lhA'
|
||||
alias sl=ls
|
||||
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
#alias ...='cd ../..'
|
||||
#alias ....='cd ../../..'
|
||||
|
||||
alias _="sudo"
|
||||
alias Ps="ps aux|grep --color"
|
||||
|
|
12
lib/git.zsh
12
lib/git.zsh
|
@ -128,11 +128,11 @@ function git_compare_version() {
|
|||
}
|
||||
|
||||
function git_current_branch() {
|
||||
git branch |grep "*"|cut -d ' ' -f 2
|
||||
git branch --show-current
|
||||
}
|
||||
|
||||
function git_push() {
|
||||
git push origin `git_current_branch`
|
||||
git push origin `git_current_branch` "$@"
|
||||
}
|
||||
|
||||
function git_pull() {
|
||||
|
@ -147,6 +147,14 @@ function git_changed_files_since_master() {
|
|||
git_changed_files $(git_current_branch) master
|
||||
}
|
||||
|
||||
function git_commits_from() {
|
||||
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $1..$(git branch --show-current)
|
||||
}
|
||||
|
||||
function reset_branch_commits() {
|
||||
git reset $(git merge-base $1 $(git branch --show-current))
|
||||
}
|
||||
|
||||
#this is unlikely to change so make it all statically assigned
|
||||
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
|
||||
#clean up the namespace slightly by removing the checker function
|
||||
|
|
Loading…
Reference in New Issue