• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

PyGitUp/H03-May-2022-2,6451,607

PKG-INFOH A D03-May-202215 KiB428303

README.rstH A D03-May-202214.1 KiB402279

pyproject.tomlH A D03-May-20221.1 KiB4739

setup.pyH A D03-May-202215.3 KiB3526

README.rst

1PyGitUp |Version| |Build Status| |Coverage Status|
2==================================================
3
4|PyGitUp|_ is a Python port of
5`aanand/git-up <https://github.com/aanand/git-up/>`__. It not only
6fully covers the abilities of git-up and should be a drop-in replacement,
7but also extends it slightly.
8
9.. |PyGitUp| replace:: ``PyGitUp``
10.. _PyGitUp: https://github.com/msiemens/PyGitUp
11
12Why use ``git up``?
13-------------------
14
15    git pull has two problems:
16
17    * It merges upstream changes by default, when it's really more polite to `rebase
18      over them <http://gitready.com/advanced/2009/02/11/pull-with-rebase.html>`__,
19      unless your collaborators enjoy a commit graph that looks like bedhead.
20
21    * It only updates the branch you're currently on, which means git push will
22      shout at you for being behind on branches you don't particularly care about
23      right now.
24
25    (https://github.com/aanand/git-up/)
26
27Demonstration
28-------------
29
30.. image:: http://i.imgur.com/EC3pvYu.gif
31
32Why use the Python port?
33------------------------
34
35I wasn't able to use the original ``git-up``, because I didn't want to install
36a whole Ruby suite just for `git-up` and even with Ruby installed, there were
37some problems running on my Windows machine. So, my reasons for writing
38and using this port are:
39
401. Windows support.
412. Written in Python ;)
42
43How do I install it?
44--------------------
45
461. Install ``git-up`` via `pip <https://pip.pypa.io/en/latest/installing.html>`__: ``$ pip install git-up``
472. ``cd`` to your project's directory.
483. Run ``git up`` and enjoy!
49
50Note for Windows users:
51~~~~~~~~~~~~~~~~~~~~~~~
52
53See `these instructions <http://stackoverflow.com/q/4750806/997063>`__
54for installing pip, if you haven't already installed it. And don't forget
55to either:
56
57- make your ``Python/Scripts`` and ``Python/Lib/site-packages`` writable for
58  you,
59- run ``pip`` with admin privileges
60- or use ``pip install --user git-up`` and add ``%APPDATA%/Python/Scripts``
61  to ``%PATH%``.
62
63Otherwise pip will refuse to install ``git-up`` due to ``Access denied`` errors.
64
65Python version compatibility:
66~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67
68Python 3.7 and upwards are supported :)
69
70Options and Configuration
71-------------------------
72
73Command Line Arguments
74~~~~~~~~~~~~~~~~~~~~~~
75
76- ``git up -h`` shows a help message.
77
78- ``git up --quiet`` suppresses all output except for error messages.
79
80- ``git up --no-fetch`` skips fetching the remote and rebases all local branches.
81
82- ``git up --version`` shows the current version and optionally checks for
83  updates (see below).
84
85Configuration
86~~~~~~~~~~~~~
87
88To configure ``PyGitUp``, you can set options in your git config. Run
89``git config [--global] git-up.[name] [value]`` to set one of these
90options:
91
92-  ``git-up.fetch.prune [*true*|false]``: If set to ``true``,
93   ``PyGitUp`` will append the ``--prune``\ option to ``git fetch`` and
94   thus remove any remote tracking branches which no longer exist on
95   the remote (see `git fetch
96   --help <http://linux.die.net/man/1/git-fetch>`__).
97
98-  ``git-up.fetch.all [true|*false*]``: If set to ``false``, ``PyGitUp``
99   will only fetch remotes for which there is at least one local
100   tracking branch. Setting this option will make ``git up`` always fetch
101   from all remotes, which is useful if e.g. you use a remote to push to
102   your CI system but never check those branches out.
103
104- ``git-up.push.auto [true|*false*]``: Push the current branch after
105  rebasing and fast-forwarding.
106
107- ``git-up.push.all [true|*false*]``: Push all branches when auto-pushing.
108
109- ``git-up.push.tags [true|*false*]``: Push tags when auto-pushing.
110
111-  ``git-up.rebase.arguments [string]``: If set, ``PyGitUp`` will use
112   this string as additional arguments when calling ``git rebase``.
113   Example: ``--preserve-merges`` to recreate merge commits in the
114   rebased branch.
115
116-  ``git-up.rebase.auto [*true*|false]``: If set to ``false``,
117   ``PyGitUp`` won't rebase your branches for you but notify you that
118   they diverged. This can be useful if you have a lot of in-progress
119   work that you don't want to deal with at once, but still want to
120   update other branches.
121
122-  ``git-up.rebase.log-hook [cmd]``: Runs ``cmd`` every time a branch
123   is rebased or fast-forwarded, with the old head as ``$1`` and the new
124   head as ``$2``. This can be used to view logs or diffs of incoming
125   changes. Example:
126   ``echo "changes on $1:"; git log --oneline --decorate $1..$2``.
127
128- ``git-up.rebase.show-hashes [true|*false*]``: If set to ``true``,
129  ``PyGitUp`` will show the hashes of the current commit (or the point
130  where the rebase starts) and the target commit like ``git pull`` does.
131
132New in v1.0.0:
133~~~~~~~~~~~~~~
134
135- ``git-up.updates.check [*true*|false]``: When running ``git up --version``,
136  it shows the version number and checks for updates. If you feel
137  uncomfortable with it, just set it to ``false`` to turn off the checks.
138
139Credits
140-------
141
142The original ``git-up`` has been written by aanand:
143`aanand/git-up/ <https://github.com/aanand/git-up/>`__.
144
145
146Changelog
147---------
148
149v2.1.0 (*2021-10-02*)
150~~~~~~~~~~~~~~~~~~~~~
151
152- Switch to Python's ``argparse`` for CLI argument parsing. Thanks
153  `@ekohl <https://github.com/ekohl>`_ for `Pull Request #96
154  <https://github.com/msiemens/PyGitUp/pull/96>`_.
155
156v2.0.3 (*2021-09-23*)
157~~~~~~~~~~~~~~~~~~~~~
158
159- Drop support for Python 3.6 (following GitPython)
160- Update PyGitUp's CLI argument parser `Click <https://click.palletsprojects.com/en/8.0.x/>`_
161  to version 8.0. Thanks `@hugovk <https://github.com/hugovk>`_
162  for `Pull Request #109 <https://github.com/msiemens/PyGitUp/pull/109>`_.
163- Update other dependencies
164
165v2.0.2 (*2020-12-30*)
166~~~~~~~~~~~~~~~~~~~~~
167
168- Remove old Python 2 code. Thanks `@hugovk <https://github.com/hugovk>`_
169  for `Pull Request #104 <https://github.com/msiemens/PyGitUp/pull/104>`_.
170
171v2.0.1 (*2020-08-26*)
172~~~~~~~~~~~~~~~~~~~~~
173
174- Update dependencies
175
176v2.0.0 (*2020-08-15*)
177~~~~~~~~~~~~~~~~~~~~~
178
179- Drop Python 2 support in order to fix `Issue 102 <https://github.com/msiemens/PyGitUp/issues/102>`_
180- Drop Ruby Bundler integration
181- Migrate tests to ``py.test``
182
183v1.6.1 (*2018-12-12*)
184~~~~~~~~~~~~~~~~~~~~~
185
186- Upgrade to click>=7.0.0. Thanks `@no-preserve-root <https://github.com/no-preserve-root>`_
187  for `Pull Request #87 <https://github.com/msiemens/PyGitUp/pull/87>`_.
188
189v1.6.0 (*2018-10-26*)
190~~~~~~~~~~~~~~~~~~~~~
191
192- Skip stashing changes when possible. Thanks `@Chronial <https://github.com/Chronial>`_
193  for `Pull Request #86 <https://github.com/msiemens/PyGitUp/pull/86>`_.
194- Added faster fast-forward on branches that are not checked out. Thanks `@Chronial <https://github.com/Chronial>`_
195  for `Pull Request #83 <https://github.com/msiemens/PyGitUp/pull/83>`_.
196
197v1.5.2 (*2018-09-28*)
198~~~~~~~~~~~~~~~~~~~~~
199
200- Fixed version requirement for Click dependency (`#82 <https://github.com/msiemens/PyGitUp/issues/82>`__).
201
202v1.5.1 (*2018-09-13*)
203~~~~~~~~~~~~~~~~~~~~~
204
205- Fixed crash on Cygwin with rebase log hook enabled (`#80 <https://github.com/msiemens/PyGitUp/issues/80>`__).
206
207v1.5.0 (*2018-04-26*)
208~~~~~~~~~~~~~~~~~~~~~
209
210- Added auto-push support. Thanks `@WoLpH <https://github.com/WoLpH>`_
211  for `Pull Request #74 <https://github.com/msiemens/PyGitUp/pull/74>`_.
212
213v1.4.7 (*2018-04-07*)
214~~~~~~~~~~~~~~~~~~~~~
215
216- Added shorthand commandline arguments (``-V, -q, -h``, see `#73 <https://github.com/msiemens/PyGitUp/issues/73>`__).
217
218v1.4.6 (*2017-12-19*)
219~~~~~~~~~~~~~~~~~~~~~
220
221- 3rd party dependencies have been updated (see `#65 <https://github.com/msiemens/PyGitUp/issues/65>`__).
222
223v1.4.5 (*2017-01-02*)
224~~~~~~~~~~~~~~~~~~~~~
225
226- Fixed problems when working with branches containing hash signs in their name
227  (`#55 <https://github.com/msiemens/PyGitUp/issues/55>`__).
228- No longer installs a now unneeded script on ``pip install``. Thanks `@ekohl <https://github.com/ekohl>`_
229  for `Pull Request #60 <https://github.com/msiemens/PyGitUp/pull/60>`_.
230
231v1.4.4 (*2016-11-30*)
232~~~~~~~~~~~~~~~~~~~~~
233
234- Fixed a bug when working with ``git worktree`` (`#58 <https://github.com/msiemens/PyGitUp/issues/58>`__).
235
236v1.4.3 (*2016-11-22*)
237~~~~~~~~~~~~~~~~~~~~~
238
239- Fixed a bug with GitPython <= 2.0.8 (`#56 <https://github.com/msiemens/PyGitUp/issues/56>`__, `#57 <https://github.com/msiemens/PyGitUp/issues/57>`__).
240
241v1.4.2 (*2016-09-29*)
242~~~~~~~~~~~~~~~~~~~~~
243
244- Switched the command line argument parsing library (`#53 <https://github.com/msiemens/PyGitUp/issues/53>`__).
245
246v1.4.1 (*2016-08-02*)
247~~~~~~~~~~~~~~~~~~~~~
248
249- Include tests in PyPI distribution (`#51 <https://github.com/msiemens/PyGitUp/issues/51>`__).
250
251v1.4.0 (*2016-02-29*)
252~~~~~~~~~~~~~~~~~~~~~
253
254- 3rd party dependencies have been updated.
255- Dependencies on 3rd party libraries have been loosened to better interact with other installed packages.
256  Thanks `MaximilianR <https://github.com/MaximilianR>`_ for `Pull Request #45 <https://github.com/msiemens/PyGitUp/pull/45>`_.
257- Added an command line argument to turn of fetching (``--no-fetch``). Thanks `@buoto <https://github.com/buoto>`_
258  for `Pull Request #46 <https://github.com/msiemens/PyGitUp/pull/46>`_.
259- Don't show a stacktrace anymore when stashing fails (`#35 <https://github.com/msiemens/PyGitUp/issues/35>`_).
260- Fixed a bug that caused problems with submodules if the submodule had unstashed changes/ Thanks
261  `@Javex <https://github.com/Javex>`_ for `Pull Request #27 <https://github.com/msiemens/PyGitUp/pull/27>`_.
262
263v1.3.1 (*2015-08-31*)
264~~~~~~~~~~~~~~~~~~~~~
265
266- Fixed a bug when showing the version on Python 3 `#34 <https://github.com/msiemens/PyGitUp/issues/34>`__.
267
268v1.3.0 (*2015-04-08*)
269~~~~~~~~~~~~~~~~~~~~~
270
271- Support for Python 3 has been added. Thanks `@r4ts0n <https://github.com/r4ts0n>`_
272  for `Pull Request #23 <https://github.com/msiemens/PyGitUp/pull/23>`_
273  and `@Byron <https://github.com/Byron>`_ for quickly merging a Pull Request
274  in `GitPython <https://github.com/gitpython-developers/GitPython>`_
275  and releasing a new version on which this release depends.
276
277v1.2.2 (*2015-02-23*)
278~~~~~~~~~~~~~~~~~~~~~
279
280- Now updates submodules when called from ``git submodule foreach`` (`#8 <https://github.com/msiemens/PyGitUp/issues/8>`__).
281
282v1.2.1 (*2014-12-16*)
283~~~~~~~~~~~~~~~~~~~~~
284
285- Fixed a problem with ``setuptools 8.x`` (`#19 <https://github.com/msiemens/PyGitUp/issues/19>`__).
286- 3rd party dependencies have been updated
287
288v1.2.0 (*2014-12-10*)
289~~~~~~~~~~~~~~~~~~~~~
290
291- Added an option to show hashes when fast-forwarding/rebasing like ``git pull``
292  does (``git-up.rebase.show-hashes``).
293- Fixed a bug when having branches with both local tracking branches and
294  remote tracking branches (`#17 <https://github.com/msiemens/PyGitUp/issues/17>`__).
295
296v1.1.5 (*2014-11-19*)
297~~~~~~~~~~~~~~~~~~~~~
298
299- 3rd party dependencies have been updated to fix a problem with a 3rd party
300  library (`#18 <https://github.com/msiemens/PyGitUp/issues/18>`__).
301
302v1.1.4 (*2014-04-18*)
303~~~~~~~~~~~~~~~~~~~~~
304
305- Fixed some typos in README and ``PyGitUp`` output.
306- 3rd party dependencies have been updated.
307
308v1.1.3 (*2014-03-23*)
309~~~~~~~~~~~~~~~~~~~~~
310
311- ``ahead of upstream`` messages are now cyan (see `aanand/git-up#60 <https://github.com/aanand/git-up/issues/60>`__).
312- Fixed problem when using % in the log hook (`#11 <https://github.com/msiemens/PyGitUp/issues/11>`__).
313
314v1.1.2 (*2013-10-08*)
315~~~~~~~~~~~~~~~~~~~~~
316
317- Fixed problems with the dependency declaration.
318
319v1.1.1 (*2013-10-07*)
320~~~~~~~~~~~~~~~~~~~~~
321
322- Fix for `#7 <https://github.com/msiemens/PyGitUp/issues/7>`__
323  (AttributeError: 'GitUp' object has no attribute 'git') introduced by
324  v1.1.0.
325
326v1.1.0 (*2013-10-07*)
327~~~~~~~~~~~~~~~~~~~~~
328
329- Prior to v1.1.0, ``PyGitUp`` tried to guess the upstream branch for a local
330  branch by looking for a branch on any remote with the same name. With v1.1.0,
331  ``PyGitUp`` stops guessing and uses the upstream branch config instead.
332
333  This by the way fixes issue `#6 <https://github.com/msiemens/PyGitUp/issues/6>`__
334  (``git up`` doesn't work with local only branches).
335
336  **Note:**
337  This change may break setups, where a local branch accidentally has
338  the same name as a remote branch without any tracking information set. Prior
339  to v1.1.0, ``git up`` would still fetch and rebase from the remote branch.
340  If you run into troubles with such a setup, setting tracking information
341  using ``git branch -u <remote>/<remote branch> <local branch>`` should help.
342
343- 3rd party dependencies have been updated.
344
345- Allows to run ``git up --version`` from non-git dirs, too.
346
347v1.0.0 (*2013-09-05*)
348~~~~~~~~~~~~~~~~~~~~~
349
350Finally ``PyGitUp`` reaches 1.0.0. You can consider it stable now :)
351
352- Added a comprehensive test suite, now with a coverage of about 90%.
353- Lots of code cleanup.
354- Added option ``-h`` to display a help screen (``--help`` **won't** work, because
355  ``git`` catches this option and handles it before ``PyGitUp`` can do).
356- Added option ``--version`` to show, what version of ``PyGitUp`` is running.
357  Also checks for updates (can be disabled, see configuration).
358- Added option ``--quiet`` to be quiet and only display error messages.
359
360v0.2.3 (*2013-06-05*)
361~~~~~~~~~~~~~~~~~~~~~
362
363- Fixed issue `#4 <https://github.com/msiemens/PyGitUp/issues/4>`__ (ugly
364  exception if remote branch has been deleted).
365
366v0.2.2 (*2013-05-04*)
367~~~~~~~~~~~~~~~~~~~~~
368
369- Fixed issue `#3 <https://github.com/msiemens/PyGitUp/issues/3>`__ (didn't
370  return to previous branch).
371
372
373v0.2.1 (*2013-03-18*)
374~~~~~~~~~~~~~~~~~~~~~
375
376- Fixed problem: check-bundler.rb has not been installed when installing via
377  PyPI (problems with setup.py).
378
379v0.2 (*2013-03-18*)
380~~~~~~~~~~~~~~~~~~~
381
382- Incorporated `aanand/git-up#41 <https://github
383  .com/aanand/git-up/pull/41>`__: Support for ``bundle install --local`` and
384  ``rbenv rehash``.
385- Fixed issue `#1 <https://github.com/msiemens/PyGitUp/issues/1>`__ (strange
386  output buffering when having multiple remotes to fetch from).
387- Some under-the-hood improvements.
388
389v0.1 (*2013-03-14*)
390~~~~~~~~~~~~~~~~~~~
391
392- Initial Release
393
394.. |Build Status| image:: https://img.shields.io/azure-devops/build/msiemens/3e5baa75-12ec-43ac-9728-89823ee8c7e2/1.svg?style=flat-square
395   :target: https://dev.azure.com/msiemens/github/_build?definitionId=1
396
397.. |Coverage Status| image:: http://img.shields.io/coveralls/msiemens/PyGitUp/master.svg?style=flat-square
398  :target: https://coveralls.io/r/msiemens/PyGitUp
399
400.. |Version| image:: http://img.shields.io/pypi/v/git-up.svg?style=flat-square
401  :target: https://pypi.python.org/pypi/git-up
402