# This is a shell library to calculate the remote repository and # upstream branch that should be pulled by "git pull" from the current # branch. # git-ls-remote could be called from outside a git managed repository; # this would fail in that case and would issue an error message. GIT_DIR=$(git rev-parse -q --git-dir) || :; get_default_remote () { curr_branch=$(git symbolic-ref -q HEAD) curr_branch="${curr_branch#refs/heads/}" origin=$(git config --get "branch.$curr_branch.remote") echo ${origin:-origin} } get_remote_merge_branch () { case "$#" in 0|1) origin="$1" default=$(get_default_remote) test -z "$origin" && origin=$default curr_branch=$(git symbolic-ref -q HEAD) && [ "$origin" = "$default" ] && echo $(git for-each-ref --format='%(upstream)' $curr_branch) ;; *) repo=$1 shift ref=$1 # FIXME: It should return the tracking branch # Currently only works with the default mapping case "$ref" in +*) ref=$(expr "z$ref" : 'z+\(.*\)') ;; esac expr "z$ref" : 'z.*:' >/dev/null || ref="${ref}:" remote=$(expr "z$ref" : 'z\([^:]*\):') case "$remote" in '' | HEAD ) remote=HEAD ;; heads/*) remote=${remote#heads/} ;; refs/heads/*) remote=${remote#refs/heads/} ;; refs/* | tags/* | remotes/* ) remote= esac [ -n "$remote" ] && case "$repo" in .) echo "refs/heads/$remote" ;; *) echo "refs/remotes/$repo/$remote" ;; esac esac } error_on_missing_default_upstream () { cmd="$1" op_type="$2" op_prep="$3" # FIXME: op_prep is no longer used example="$4" branch_name=$(git symbolic-ref -q HEAD) display_branch_name="${branch_name#refs/heads/}" # If there's only one remote, use that in the suggestion remote="$(gettext "<remote>")" branch="$(gettext "<branch>")" if test $(git remote | wc -l) = 1 then remote=$(git remote) fi if test -z "$branch_name" then gettextln "You are not currently on a branch." else gettextln "There is no tracking information for the current branch." fi case "$op_type" in rebase) gettextln "Please specify which branch you want to rebase against." ;; merge) gettextln "Please specify which branch you want to merge with." ;; *) echo >&2 "BUG: unknown operation type: $op_type" exit 1 ;; esac eval_gettextln "See git-\${cmd}(1) for details." echo echo " $example" echo if test -n "$branch_name" then gettextln "If you wish to set tracking information for this branch you can do so with:" echo echo " git branch --set-upstream-to=$remote/$branch $display_branch_name" echo fi exit 1 }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
mergetools | Folder | 0755 |
|
|
git | File | 2.27 MB | 0755 |
|
git-add | File | 2.27 MB | 0755 |
|
git-add--interactive | File | 42.89 KB | 0755 |
|
git-am | File | 2.27 MB | 0755 |
|
git-annotate | File | 2.27 MB | 0755 |
|
git-apply | File | 2.27 MB | 0755 |
|
git-archive | File | 2.27 MB | 0755 |
|
git-bisect | File | 14.11 KB | 0755 |
|
git-bisect--helper | File | 2.27 MB | 0755 |
|
git-blame | File | 2.27 MB | 0755 |
|
git-branch | File | 2.27 MB | 0755 |
|
git-bundle | File | 2.27 MB | 0755 |
|
git-cat-file | File | 2.27 MB | 0755 |
|
git-check-attr | File | 2.27 MB | 0755 |
|
git-check-ignore | File | 2.27 MB | 0755 |
|
git-check-mailmap | File | 2.27 MB | 0755 |
|
git-check-ref-format | File | 2.27 MB | 0755 |
|
git-checkout | File | 2.27 MB | 0755 |
|
git-checkout-index | File | 2.27 MB | 0755 |
|
git-cherry | File | 2.27 MB | 0755 |
|
git-cherry-pick | File | 2.27 MB | 0755 |
|
git-clean | File | 2.27 MB | 0755 |
|
git-clone | File | 2.27 MB | 0755 |
|
git-column | File | 2.27 MB | 0755 |
|
git-commit | File | 2.27 MB | 0755 |
|
git-commit-tree | File | 2.27 MB | 0755 |
|
git-config | File | 2.27 MB | 0755 |
|
git-count-objects | File | 2.27 MB | 0755 |
|
git-credential | File | 2.27 MB | 0755 |
|
git-credential-cache | File | 1.26 MB | 0755 |
|
git-credential-cache--daemon | File | 1.27 MB | 0755 |
|
git-credential-store | File | 1.27 MB | 0755 |
|
git-daemon | File | 1.28 MB | 0755 |
|
git-describe | File | 2.27 MB | 0755 |
|
git-diff | File | 2.27 MB | 0755 |
|
git-diff-files | File | 2.27 MB | 0755 |
|
git-diff-index | File | 2.27 MB | 0755 |
|
git-diff-tree | File | 2.27 MB | 0755 |
|
git-difftool | File | 2.27 MB | 0755 |
|
git-difftool--helper | File | 2.19 KB | 0755 |
|
git-fast-export | File | 2.27 MB | 0755 |
|
git-fast-import | File | 1.3 MB | 0755 |
|
git-fetch | File | 2.27 MB | 0755 |
|
git-fetch-pack | File | 2.27 MB | 0755 |
|
git-filter-branch | File | 15.17 KB | 0755 |
|
git-fmt-merge-msg | File | 2.27 MB | 0755 |
|
git-for-each-ref | File | 2.27 MB | 0755 |
|
git-format-patch | File | 2.27 MB | 0755 |
|
git-fsck | File | 2.27 MB | 0755 |
|
git-fsck-objects | File | 2.27 MB | 0755 |
|
git-gc | File | 2.27 MB | 0755 |
|
git-get-tar-commit-id | File | 2.27 MB | 0755 |
|
git-grep | File | 2.27 MB | 0755 |
|
git-hash-object | File | 2.27 MB | 0755 |
|
git-help | File | 2.27 MB | 0755 |
|
git-http-backend | File | 1.27 MB | 0755 |
|
git-http-fetch | File | 1.31 MB | 0755 |
|
git-http-push | File | 1.32 MB | 0755 |
|
git-imap-send | File | 1.32 MB | 0755 |
|
git-index-pack | File | 2.27 MB | 0755 |
|
git-init | File | 2.27 MB | 0755 |
|
git-init-db | File | 2.27 MB | 0755 |
|
git-instaweb | File | 18.11 KB | 0755 |
|
git-interpret-trailers | File | 2.27 MB | 0755 |
|
git-log | File | 2.27 MB | 0755 |
|
git-ls-files | File | 2.27 MB | 0755 |
|
git-ls-remote | File | 2.27 MB | 0755 |
|
git-ls-tree | File | 2.27 MB | 0755 |
|
git-mailinfo | File | 2.27 MB | 0755 |
|
git-mailsplit | File | 2.27 MB | 0755 |
|
git-merge | File | 2.27 MB | 0755 |
|
git-merge-base | File | 2.27 MB | 0755 |
|
git-merge-file | File | 2.27 MB | 0755 |
|
git-merge-index | File | 2.27 MB | 0755 |
|
git-merge-octopus | File | 2.42 KB | 0755 |
|
git-merge-one-file | File | 3.62 KB | 0755 |
|
git-merge-ours | File | 2.27 MB | 0755 |
|
git-merge-recursive | File | 2.27 MB | 0755 |
|
git-merge-resolve | File | 944 B | 0755 |
|
git-merge-subtree | File | 2.27 MB | 0755 |
|
git-merge-tree | File | 2.27 MB | 0755 |
|
git-mergetool | File | 10.06 KB | 0755 |
|
git-mergetool--lib | File | 8.66 KB | 0644 |
|
git-mktag | File | 2.27 MB | 0755 |
|
git-mktree | File | 2.27 MB | 0755 |
|
git-mv | File | 2.27 MB | 0755 |
|
git-name-rev | File | 2.27 MB | 0755 |
|
git-notes | File | 2.27 MB | 0755 |
|
git-pack-objects | File | 2.27 MB | 0755 |
|
git-pack-redundant | File | 2.27 MB | 0755 |
|
git-pack-refs | File | 2.27 MB | 0755 |
|
git-parse-remote | File | 2.59 KB | 0644 |
|
git-patch-id | File | 2.27 MB | 0755 |
|
git-prune | File | 2.27 MB | 0755 |
|
git-prune-packed | File | 2.27 MB | 0755 |
|
git-pull | File | 2.27 MB | 0755 |
|
git-push | File | 2.27 MB | 0755 |
|
git-quiltimport | File | 3.51 KB | 0755 |
|
git-read-tree | File | 2.27 MB | 0755 |
|
git-rebase | File | 16.89 KB | 0755 |
|
git-rebase--am | File | 2.62 KB | 0644 |
|
git-rebase--helper | File | 2.27 MB | 0755 |
|
git-rebase--interactive | File | 28.25 KB | 0644 |
|
git-rebase--merge | File | 4 KB | 0644 |
|
git-receive-pack | File | 2.27 MB | 0755 |
|
git-reflog | File | 2.27 MB | 0755 |
|
git-remote | File | 2.27 MB | 0755 |
|
git-remote-ext | File | 2.27 MB | 0755 |
|
git-remote-fd | File | 2.27 MB | 0755 |
|
git-remote-ftp | File | 1.32 MB | 0755 |
|
git-remote-ftps | File | 1.32 MB | 0755 |
|
git-remote-http | File | 1.32 MB | 0755 |
|
git-remote-https | File | 1.32 MB | 0755 |
|
git-remote-testsvn | File | 1.28 MB | 0755 |
|
git-repack | File | 2.27 MB | 0755 |
|
git-replace | File | 2.27 MB | 0755 |
|
git-request-pull | File | 3.61 KB | 0755 |
|
git-rerere | File | 2.27 MB | 0755 |
|
git-reset | File | 2.27 MB | 0755 |
|
git-rev-list | File | 2.27 MB | 0755 |
|
git-rev-parse | File | 2.27 MB | 0755 |
|
git-revert | File | 2.27 MB | 0755 |
|
git-rm | File | 2.27 MB | 0755 |
|
git-send-pack | File | 2.27 MB | 0755 |
|
git-sh-i18n | File | 2.3 KB | 0644 |
|
git-sh-i18n--envsubst | File | 1.26 MB | 0755 |
|
git-sh-prompt | File | 16 KB | 0644 |
|
git-sh-setup | File | 9.04 KB | 0644 |
|
git-shell | File | 1.26 MB | 0755 |
|
git-shortlog | File | 2.27 MB | 0755 |
|
git-show | File | 2.27 MB | 0755 |
|
git-show-branch | File | 2.27 MB | 0755 |
|
git-show-index | File | 1.26 MB | 0755 |
|
git-show-ref | File | 2.27 MB | 0755 |
|
git-stage | File | 2.27 MB | 0755 |
|
git-stash | File | 15.12 KB | 0755 |
|
git-status | File | 2.27 MB | 0755 |
|
git-stripspace | File | 2.27 MB | 0755 |
|
git-submodule | File | 23.38 KB | 0755 |
|
git-submodule--helper | File | 2.27 MB | 0755 |
|
git-subtree | File | 16.11 KB | 0755 |
|
git-symbolic-ref | File | 2.27 MB | 0755 |
|
git-tag | File | 2.27 MB | 0755 |
|
git-unpack-file | File | 2.27 MB | 0755 |
|
git-unpack-objects | File | 2.27 MB | 0755 |
|
git-update-index | File | 2.27 MB | 0755 |
|
git-update-ref | File | 2.27 MB | 0755 |
|
git-update-server-info | File | 2.27 MB | 0755 |
|
git-upload-archive | File | 2.27 MB | 0755 |
|
git-upload-pack | File | 1.27 MB | 0755 |
|
git-var | File | 2.27 MB | 0755 |
|
git-verify-commit | File | 2.27 MB | 0755 |
|
git-verify-pack | File | 2.27 MB | 0755 |
|
git-verify-tag | File | 2.27 MB | 0755 |
|
git-web--browse | File | 4.3 KB | 0755 |
|
git-whatchanged | File | 2.27 MB | 0755 |
|
git-worktree | File | 2.27 MB | 0755 |
|
git-write-tree | File | 2.27 MB | 0755 |
|