git-nav-upstream 335 B

1234567891011
  1. #!/usr/bin/env bash
  2. # Copyright 2014 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. if git rev-parse 2> /dev/null; then
  6. git checkout "$(git rev-parse --abbrev-ref "@{u}")"
  7. else
  8. echo "error: not in a git repository" >&2
  9. exit 1
  10. fi