A console script that allows you to easily update multiple git repositories at once
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. __gitup__ (the _git-repo-updater_)
  2. gitup is a tool designed to update a large number of git repositories at once.
  3. It is smart enough to handle multiple remotes, branches, dirty working
  4. directories, and more, hopefully providing a great way to get everything
  5. up-to-date for short periods of internet access between long periods of none.
  6. # Requirements
  7. gitup should work on OS X, Linux, and Windows. You should have the latest
  8. version of git and either Python 2.7 or Python 3 installed with the [setuptools](https://github.com/pypa/setuptools) extension (if it's missing, check for `pip install setuptools`).
  9. # Installation
  10. With [Homebrew](http://brew.sh/):
  11. brew install gitup
  12. ## From source
  13. First:
  14. git clone git://github.com/earwig/git-repo-updater.git
  15. cd git-repo-updater
  16. Then, to install for everyone:
  17. sudo python setup.py install
  18. ...or for just yourself (make sure you have `~/.local/bin` in your PATH):
  19. python setup.py install --user
  20. Finally, simply delete the `git-repo-updater` directory, and you're done!
  21. __Note:__ If you are using Windows, you may wish to add a macro so you can
  22. invoke gitup in any directory. Note that `C:\python27\` refers to the
  23. directory where Python is installed:
  24. DOSKEY gitup=c:\python27\python.exe c:\python27\Scripts\gitup $*
  25. # Usage
  26. There are two ways to update repos: you can pass them as command arguments,
  27. or save them as "bookmarks".
  28. For example:
  29. gitup ~/repos/foo ~/repos/bar ~/repos/baz
  30. will automatically pull to the `foo`, `bar`, and `baz` git repositories.
  31. Additionally, you can just type:
  32. gitup ~/repos
  33. to automatically update all git repositories in that directory.
  34. To add a bookmark (or bookmarks), either of these will work:
  35. gitup --add ~/repos/foo ~/repos/bar ~/repos/baz
  36. gitup --add ~/repos
  37. Then, to update all of your bookmarks, just run gitup without args:
  38. gitup
  39. Delete a bookmark:
  40. gitup --delete ~/repos
  41. View your current bookmarks:
  42. gitup --list
  43. You can mix and match bookmarks and command arguments:
  44. gitup --add ~/repos/foo ~/repos/bar
  45. gitup ~/repos/baz # update 'baz' only
  46. gitup # update 'foo' and 'bar' only
  47. gitup ~/repos/baz --update # update all three!
  48. Update all git repositories in your current directory:
  49. gitup .
  50. By default, gitup will fetch all remotes in a repository. Pass `--current-only`
  51. (or `-c`) to make it fetch _only_ the remote tracked by the current branch.
  52. Also by default, gitup will try to fast-forward all branches that have
  53. upstreams configured. It will always skip branches where this is not possible
  54. (e.g. dirty working directory or a merge/rebase is required). Pass
  55. `--fetch-only` (or `-f`) to only fetch remotes.
  56. After fetching, gitup will _keep_ remote-tracking branches that no longer exist
  57. upstream. Pass `--prune` (or `-p`) to delete them, or set `fetch.prune` or
  58. `remote.<name>.prune` in git config to do this by default.
  59. For a full list of all command arguments and abbreviations:
  60. gitup --help
  61. Finally, all paths can be either absolute (e.g. `/path/to/repo`) or relative
  62. (e.g. `../my/repo`).