Skip to content

Instantly share code, notes, and snippets.

@upvalue
Last active March 14, 2017 20:16
Show Gist options
  • Save upvalue/a8d821df03916d72a4207ee800e48b96 to your computer and use it in GitHub Desktop.
Save upvalue/a8d821df03916d72a4207ee800e48b96 to your computer and use it in GitHub Desktop.
Fix go get "you are not currently on a branch" error
#!/bin/bash
# https://groups.google.com/forum/#!topic/golang-nuts/t9dLLVwsMlM
# run in a directory of git repos e.g. ~/go/src/golang.org/x
for dir in ./*; do # use ./*/* for two-level directories eg ~/go/src/github.com
pushd $dir;
git pull --ff-only origin master;
popd;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment