Skip to main content

A python implementation of 'git up'

Project description

PyGitUp is a Python implementation of the great aanand/git-up/. It not only fully covers the abilities of git-up and should be a drop-in replacement, but also extends it slightly.

Why using git up?

git pull has two problems:

  • It merges upstream changes by default, when it’s really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.

  • It only updates the branch you’re currently on, which means git push will shout at you for being behind on branches you don’t particularly care about right now.

(https://github.com/aanand/git-up/)

Demonstration

http://i.imgur.com/EC3pvYu.gif

Why using the Python port?

I wasn’t able to use the original git-up, because I didn’t want to install a whole Ruby suite just for git-up and even with Ruby installed, there were some problems running on my Windows machine. So, my reasons for writing and using this port are:

  1. Windows support.

  2. Written in Python ;)

How do I install it?

  1. Run $ pip install git-up

  2. cd to your project’s directory.

  3. Run git up enjoy!

Note for Windows users:

You need pip installed and working. Check out SO#4750806 for more information. And don’t forget to either:

  • make your Python/Scripts and Python/Lib/site-packages writable for you,

  • run pip with admin privileges

  • or use pip install --user git-up and add %APPDATA%/Python/Scripts to %PATH%

otherwise pip won’t install due to Access denied errors.

Compatibility note:

PyGitUp is not compatible with Python 3 because some essential 3rd party libs don’t support it. Sorry.

How to configure it?

To configure PyGitUp, you can set options in your git config. Run git config [--global] git-up.[name] [value] to set one of these options:

  • git-up.bundler.check [true|*false*]: If set to true,PyGitUp will check your app for any new bundled gems and suggest a bundle install if necessary.

  • git-up.bundler.autoinstall [true|*false*]: If set to true,PyGitUp will run bundle install automatically. Requires git-up.bundler.check to be true.

  • git-up.bundler.local [true|*false*]: If you’ve bundle package-ed your project gems, you can tell PyGitUp to run bundle install --local for you if it finds missing gems. Much faster than just a plain old bundle install. Don’t worry if you’re missing gems, it will backtrack to bundle install if anything goes wrong. Make sure git-up.bundler.autoinstall is also set to true or it won’t do anything.

  • git-up.bundler.rbenv [true|*false*]: If you have rbenv installed, you can tell PyGitUp to run rbenv rehash for you after it installs your gems so any binaries will be available right away. Make sure git-up .bundler.autoinstall is also set to true or it won’t do anything.

  • git-up.fetch.prune [*true*|false]: If set to true, PyGitUp will append the --pruneoption to git fetch and thus removing any remote tracking branches which no longer exist on the remote (see git fetch –help).

  • git-up.fetch.all [true|*false*]: If set to false, PyGitUp will only fetch remotes for which there is at least one local tracking branch. Setting this option will it git up always fetch from all remotes, which is useful if e.g. you use a remote to push to your CI system but never check those branches out.

  • git-up.rebase.arguments [string]: If set, PyGitUp will use this string as additional arguments when calling git rebase. Example: --preserve-merges to recreate merge commits in the rebased branch.

  • git-up.rebase.auto [*true*|false]: If set to false, PyGitUp won’t rebase your branches for you but notify you that they diverged. This can be useful if you have a lot of in-progress work that you don’t want to deal with at once, but still want to update other branches.

  • git-up.rebase.log-hook [cmd]: Runs cmd every time a branch is rebased or fast-forwarder, with the old head as $1 and the new head as $2. This can be used to view logs or diffs of incoming changes. Example: ‘echo "changes on $1:"; git log --oneline --decorate $1..$2

New in v1.0.0:

  • git-up.updates.check [*true*|false]: When running git up --version, it shows the version number and checks for updates. If you nevertheless feel uncomfortable with it, just set it to false to turn off the checks.

Credits

The original git-up has been written by aanand: aanand/git-up/.

Changelog

v1.0.0 (2013-09-05)

Finally PyGitUp reaches 1.0.0. You can consider it stable now :)

  • Added a comprehensive test suite, now with a coverage of about 90%.

  • Lots of code cleanup.

  • Added option -h to display a help screen (--help won’t work, because git catchs this option and handles it before PyGitUp can do).

  • Added option --version to show, what version of PyGitUp is running. Also checks for updates (can be disabled, see configuration).

  • Added option --quiet to be quiet and only display error messages.

v0.2.3 (2013-06-05)

  • Fixed issue #4 (ugly exception if remote branch has been deleted).

v0.2.2 (2013-05-04)

  • Fixed issue #3 (didn’t return to previous branch).

v0.2.1 (2013-03-18)

  • Fixed problem: check-bundler.rb has not been installed when installing via PyPI (problems with setup.py).

v0.2 (2013-03-18)

  • Incorporated aanand/git-up#41: Support for bundle install --local and rbenv rehash.

  • Fixed issue #1 (strange output buffering when having multiple remotes to fetch from).

  • Some under-the-hood improvements.

v0.1 (2013-03-14)

  • Initial Release

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

git-up-1.0.0.zip (34.8 kB view details)

Uploaded Source

Built Distribution

git_up-1.0.0-py27-none-any.whl (73.8 kB view details)

Uploaded Python 2.7

File details

Details for the file git-up-1.0.0.zip.

File metadata

  • Download URL: git-up-1.0.0.zip
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for git-up-1.0.0.zip
Algorithm Hash digest
SHA256 4b8beb812ff05dba3c2df16b91fc88bc4c367f07a1542f9faf5258e9abd982e0
MD5 a07dec2f284473988f4ff4ebbfaf7944
BLAKE2b-256 100ba2567b7ac1d6982e5304610fb14b285bdca207d2a1726baceeda811e0c27

See more details on using hashes here.

File details

Details for the file git_up-1.0.0-py27-none-any.whl.

File metadata

File hashes

Hashes for git_up-1.0.0-py27-none-any.whl
Algorithm Hash digest
SHA256 55ee7c1dfc6a2adb4daab073be067e9e723b277823febcf5636ecf76b7f9e05b
MD5 23def58b99cef57c42334473b68d5f12
BLAKE2b-256 fdab59ebca41cc20d514a05a15447f18f104c4451149ff2779b1662e06db9b7f

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