Bug/docfix to get fetch
This commit is contained in:
parent
2d51867efd
commit
b1d941bd0f
2 changed files with 16 additions and 16 deletions
|
|
@ -29,6 +29,7 @@ get commit %MESSAGE% | git commit -m %MESSAGE%
|
||||||
get branch %BRANCH% | stashes working tree, creates or switches branch, and checks out branch
|
get branch %BRANCH% | stashes working tree, creates or switches branch, and checks out branch
|
||||||
get rmbranch %BRANCH% | git branch -d %BRANCH% *TODO: rename?*
|
get rmbranch %BRANCH% | git branch -d %BRANCH% *TODO: rename?*
|
||||||
get fetch | Fetches all remotes and fast-forwards local branches when possible
|
get fetch | Fetches all remotes and fast-forwards local branches when possible
|
||||||
|
get fetch %BRANCHES% | Fetches and fast-forwards the specified branches
|
||||||
get status | git status
|
get status | git status
|
||||||
get review | git diff --cached
|
get review | git diff --cached
|
||||||
get diff | compare working tree with HEAD (git diff HEAD)
|
get diff | compare working tree with HEAD (git diff HEAD)
|
||||||
|
|
|
||||||
15
get
15
get
|
|
@ -84,9 +84,14 @@ fetch)
|
||||||
echo Updating
|
echo Updating
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
git fetch --all
|
git fetch --all
|
||||||
# Fast-forward all local branches. I owe a lot to http://stackoverflow.com/a/24451300/2168416
|
branches="$(list_branches)"
|
||||||
|
else
|
||||||
|
branches = "${@:2}"
|
||||||
|
git fetch "$branches"
|
||||||
|
fi
|
||||||
|
# Fast-forward local branches. I owe a lot to http://stackoverflow.com/a/24451300/2168416
|
||||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||||
for local_branch in $(list_branches); do
|
for local_branch in $branches; do
|
||||||
remote=$(git config --get branch.$local_branch.remote)
|
remote=$(git config --get branch.$local_branch.remote)
|
||||||
remote_branch=$(git config --get branch.$local_branch.merge | sed 's:refs/heads/::')
|
remote_branch=$(git config --get branch.$local_branch.merge | sed 's:refs/heads/::')
|
||||||
# Git throws an error if we try the fetch command on the current branch. Sheesh
|
# Git throws an error if we try the fetch command on the current branch. Sheesh
|
||||||
|
|
@ -96,12 +101,6 @@ if [ -z "$2" ]; then
|
||||||
git fetch $remote $remote_branch:$local_branch
|
git fetch $remote $remote_branch:$local_branch
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
|
||||||
git fetch "${@:2}"
|
|
||||||
for b in "${@:2}"; do
|
|
||||||
git fetch upstream "$b":"$b"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ignore)
|
ignore)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue