Giter Site home page Giter Site logo

irksomezeus / git-repo-updater Goto Github PK

View Code? Open in Web Editor NEW

This project forked from earwig/git-repo-updater

0.0 1.0 0.0 95 KB

A console script that allows you to easily update multiple git repositories at once

License: MIT License

Python 100.00%

git-repo-updater's Introduction

gitup (the git-repo-updater)

gitup is a tool designed to update a large number of git repositories at once. It is smart enough to handle multiple remotes, branches, dirty working directories, and more, hopefully providing a great way to get everything up-to-date for short periods of internet access between long periods of none.

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 a bookmark (or 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 .

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 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 git config to do this by default.

For a full list of all command arguments and abbreviations:

gitup --help

Finally, all paths can be either absolute (e.g. /path/to/repo) or relative (e.g. ../my/repo).

git-repo-updater's People

Contributors

botmtl avatar earwig avatar m-s- avatar pr0d1r2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.