aboutsummaryrefslogtreecommitdiff
path: root/git-checkout-branch
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-11-30 14:42:10 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-11-30 14:42:10 -0200
commitfa0002479b6487a0fc68c9caf391692c6b17100a (patch)
treeb1a826dbf01ba21084ab666743501fc221f4da57 /git-checkout-branch
parentf0733ac0be108059e28d4575e204e4e59bb9e7b6 (diff)
downloadutils-git-fa0002479b6487a0fc68c9caf391692c6b17100a.tar.gz
utils-git-fa0002479b6487a0fc68c9caf391692c6b17100a.tar.bz2
Fetch first at git-update-superproject git-checkout-branch
Diffstat (limited to 'git-checkout-branch')
-rwxr-xr-xgit-checkout-branch3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-checkout-branch b/git-checkout-branch
index f9516d4..249ce93 100755
--- a/git-checkout-branch
+++ b/git-checkout-branch
@@ -26,6 +26,9 @@ BASENAME="`basename $0`"
# Checkout the branch containing a commit
function checkout_branch {
+ # Fetch from all repositories
+ git fetch --all
+
# Check if we are in a detached HEAD
if git branch | grep -q '* (HEAD detached'; then
# Determine the commit we're in