Skip to main content

Easily update multiple git repositories at once

Project description

gitup (the git-repo-updater)

gitup is a tool for updating multiple git repositories at once. It is smart enough to handle several remotes, dirty working directories, diverged local branches, detached HEADs, and more. It was originally created to manage a large collection of projects and deal with sporadic internet access.

gitup should work on OS X, Linux, and Windows. You should have the latest version of git and either Python 2.7 or Python 3 installed.

Installation

With Homebrew:

brew install gitup

From source

First:

git clone git://github.com/earwig/git-repo-updater.git
cd git-repo-updater

Then, to install for everyone:

sudo python setup.py install

or for just yourself (make sure you have ~/.local/bin in your PATH):

python setup.py install --user

Finally, simply delete the git-repo-updater directory, and you're done!

Note: If you are using Windows, you may wish to add a macro so you can invoke gitup in any directory. Note that C:\python27\ refers to the directory where Python is installed:

DOSKEY gitup=c:\python27\python.exe c:\python27\Scripts\gitup $*

Usage

There are two ways to update repos: you can pass them as command arguments, or save them as "bookmarks".

For example:

gitup ~/repos/foo ~/repos/bar ~/repos/baz

will automatically pull to the foo, bar, and baz git repositories. Additionally, you can just type:

gitup ~/repos

to automatically update all git repositories in that directory.

To add bookmarks, either of these will work:

gitup --add ~/repos/foo ~/repos/bar ~/repos/baz
gitup --add ~/repos

Then, to update all of your bookmarks, just run gitup without args:

gitup

Delete a bookmark:

gitup --delete ~/repos

View your current bookmarks:

gitup --list

You can mix and match bookmarks and command arguments:

gitup --add ~/repos/foo ~/repos/bar
gitup ~/repos/baz            # update 'baz' only
gitup                        # update 'foo' and 'bar' only
gitup ~/repos/baz --update   # update all three!

Update all git repositories in your current directory:

gitup .

You can control how deep gitup will look for repositories in a given directory, if that directory is not a git repo by itself, with the --depth (or -t) option. --depth 0 will disable recursion entirely, meaning the provided paths must be repos by themselves. --depth 1 will descend one level (this is the old behavior from pre-0.5 gitup). --depth -1 will recurse indefinitely, which is not recommended. The default is --depth 3.

By default, gitup will fetch all remotes in a repository. Pass --current-only (or -c) to make it fetch only the remote tracked by the current branch.

Also by default, gitup will try to fast-forward all branches that have upstreams configured. It will always skip branches where this is not possible (e.g. dirty working directory or a merge/rebase is required). Pass --fetch-only (or -f) to skip this step and only fetch remotes.

After fetching, gitup will keep remote-tracking branches that no longer exist upstream. Pass --prune (or -p) to delete them, or set fetch.prune or remote.<name>.prune in your git config to do this by default.

For a full list of all command arguments and abbreviations:

gitup --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitup-0.5.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

gitup-0.5-py2.py3-none-any.whl (12.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gitup-0.5.tar.gz.

File metadata

  • Download URL: gitup-0.5.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for gitup-0.5.tar.gz
Algorithm Hash digest
SHA256 eedd461b5ef0ee288151a16d7887cd93a79edb91d3dd2ffd8d2b772f62fa3486
MD5 23eb2d09078fff1fc663719b34a6e704
BLAKE2b-256 8050e7fefec98fc82b053088e2871611e0f66dddf1d0118076d355f4422be709

See more details on using hashes here.

File details

Details for the file gitup-0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: gitup-0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for gitup-0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c3705804a7ca8d3cb9a3c832bb7578c786935040a912c4d116bae55e50faa4d2
MD5 543db9052a5cd64fc9f9d1ae0d4dbe3a
BLAKE2b-256 04fa949ae90fb5b007cbfd6239e484cecb09ddc5751987ec2d05c12f2ceb69ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page