/git-track

Make a local git branch track a remote - easily

Primary LanguageShell

git-track

Gavin Beatty gavinbeatty@gmail.com

git track: a simple shell script to ease the unnecessarily complex task of tracking a branch, i.e., setting up a local branch to track a remote one.

In other words, set up <local_branch> to track refs/remote/<remote>/<remote_branch>

NAME
       git-track - set up a local branch to track a remote branch

SYNOPSIS
       git track [OPTIONS] [<remote>] git track [OPTIONS] -l <local_branch> -d

DESCRIPTION
       A simple shell script to ease the unnecessarily complex task of
       tracking a branch.

OPTIONS
       -v, --verbose
           Print the git commands before executing them.

       -n, --dry-run
           Don’t run any of the git commands. Only print them, as in -v.

       -f, --force
           Don’t do any checks on whether <local_branch> is tracking a branch
           already or that <remote_branch> exists.

       -r, --remote-branch <remote_branch>
           Don’t reuse <local_branch> for the remote branch and use
           <remote_branch>.

       -l, --local-branch <local_branch>
           The local branch that will track the remote. If none given, use
           `git symbolic-ref HEAD\`.

       -d, --delete
           Stop <local_branch> from tracking anything.

       <remote>
           The remote where the branch you want to track exists.

EXIT STATUS
       0 on success and non-zero on failure.

AUTHOR
       Gavin Beatty <gavinbeatty@gmail.com>

RESOURCES
       Website: https://github.com/gavinbeatty/git-track

REPORTING BUGS
       Please report all bugs and wishes to <gavinbeatty@gmail.com>

COPYING
       git-track Copyright (C) 2010 Gavin Beatty, <gavinbeatty@gmail.com>

       Free use of this software is granted under the terms of the GNU General
       Public License version 3, or at your option, any later version.
       (GPLv3+)

Dependencies

  • sh: in POSIX
  • sed: in POSIX
  • git: it is very much not in POSIX.

As such, git-track should be portable across all platforms that Git supports.

License

git track Copyright 2010 Gavin Beatty gavinbeatty@gmail.com.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You can find the GNU General Public License at: http://www.gnu.org/licenses/

Install

Default prefix is /usr/local:

sudo make install

Select your own prefix:

make install prefix=~/.local