- Notifications
You must be signed in to change notification settings - Fork45
msiemens/PyGitUp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
PyGitUp is a Python port ofaanand/git-up. It not onlyfully covers the abilities of git-up and should be a drop-in replacement,but also extends it slightly.
git pull has two problems:
- It merges upstream changes by default, when it's really more polite torebaseover 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 willshout at you for being behind on branches you don't particularly care aboutright now.
I wasn't able to use the originalgit-up, because I didn't want to installa whole Ruby suite just for git-up and even with Ruby installed, there weresome problems running on my Windows machine. So, my reasons for writingand using this port are:
- Windows support.
- Written in Python ;)
- Install
git-upviapip:$ uv tool install git-up cdto your project's directory.- Run
git upand enjoy!
Homebrew users can also usebrew:brew install pygitup
Could also checkout the.github/workflows/ci-workflow.yml
- clone repo and
cdto repo directory. - Install
poetryas guided bypoetry installation doc - Run
poetry install - Run program with
poetry run git-up - Run all tests with
poetry run pytest -v --cov=PyGitUporpoetry run pytest -v --cov=PyGitUp --cov-report html - Run one test with
poetry run pytest -q PyGitUp/tests/test_version.py -v --cov=PyGitUp
Seethese instructionsfor installing pip, if you haven't already installed it. And don't forgetto either:
- make your
Python/ScriptsandPython/Lib/site-packageswritable foryou, - run
pipwith admin privileges - or use
pip install --user git-upand add%APPDATA%/Python/Scriptsto%PATH%.
Otherwise pip will refuse to installgit-up due toAccess denied errors.
Python 3.7 and upwards are supported :)
git up -hshows a help message.git up --quietsuppresses all output except for error messages.git up --no-fetchskips fetching the remote and rebases all local branches.git up --versionshows the current version and optionally checks forupdates (see below).
To configurePyGitUp, you can set options in your git config. Rungit config [--global] git-up.[name] [value] to set one of theseoptions:
git-up.fetch.prune [*true*|false]: If set totrue,PyGitUpwill append the--pruneoption togit fetchandthus remove any remote tracking branches which no longer exist onthe remote (seegit fetch--help).git-up.fetch.all [true|*false*]: If set tofalse,PyGitUpwill only fetch remotes for which there is at least one localtracking branch. Setting this option will makegit upalways fetchfrom all remotes, which is useful if e.g. you use a remote to push toyour CI system but never check those branches out.git-up.push.auto [true|*false*]: Push the current branch afterrebasing and fast-forwarding.git-up.push.all [true|*false*]: Push all branches when auto-pushing.git-up.push.tags [true|*false*]: Push tags when auto-pushing.git-up.rebase.arguments [string]: If set,PyGitUpwill usethis string as additional arguments when callinggit rebase.Example:--preserve-mergesto recreate merge commits in therebased branch.git-up.rebase.auto [*true*|false]: If set tofalse,PyGitUpwon't rebase your branches for you but notify you thatthey diverged. This can be useful if you have a lot of in-progresswork that you don't want to deal with at once, but still want toupdate other branches.git-up.rebase.log-hook [cmd]: Runscmdevery time a branchis rebased or fast-forwarded, with the old head as$1and the newhead as$2. This can be used to view logs or diffs of incomingchanges. Example:echo "changes on $1:"; git log --oneline --decorate $1..$2.git-up.rebase.show-hashes [true|*false*]: If set totrue,PyGitUpwill show the hashes of the current commit (or the pointwhere the rebase starts) and the target commit likegit pulldoes.
git-up.updates.check [*true*|false]: When runninggit up --version,it shows the version number and checks for updates. If you feeluncomfortable with it, just set it tofalseto turn off the checks.
The originalgit-up has been written by aanand:aanand/git-up/.
- Switch to
packaginginstead ofpkg_resources. Closes#139. - Fix top-level directory detection on MinGW.
- Update dependencies and switch to the uv package manager.
- Improve logging when updating large repositories. Thanks@bdmartin forPull Request #132.
- Drop support for Python 3.7
- Add support for Python 3.11. Thanks@hugovk forPull Request #118.
- Switch to Python's
argparsefor CLI argument parsing. Thanks@ekohl forPull Request #96.
- Drop support for Python 3.6 (following GitPython)
- Update PyGitUp's CLI argument parserClickto version 8.0. Thanks@hugovkforPull Request #109.
- Update other dependencies
- Remove old Python 2 code. Thanks@hugovkforPull Request #104.
- Update dependencies
- Drop Python 2 support in order to fixIssue 102
- Drop Ruby Bundler integration
- Migrate tests to
py.test
- Upgrade to click>=7.0.0. Thanks@no-preserve-rootforPull Request #87.
- Skip stashing changes when possible. Thanks@ChronialforPull Request #86.
- Added faster fast-forward on branches that are not checked out. Thanks@ChronialforPull Request #83.
- Fixed version requirement for Click dependency (#82).
- Fixed crash on Cygwin with rebase log hook enabled (#80).
- Added auto-push support. Thanks@WoLpHforPull Request #74.
- Added shorthand commandline arguments (
-V, -q, -h, see#73).
- 3rd party dependencies have been updated (see#65).
- Fixed problems when working with branches containing hash signs in their name(#55).
- No longer installs a now unneeded script on
pip install. Thanks@ekohlforPull Request #60.
- Fixed a bug when working with
git worktree(#58).
- Switched the command line argument parsing library (#53).
- Include tests in PyPI distribution (#51).
- 3rd party dependencies have been updated.
- Dependencies on 3rd party libraries have been loosened to better interact with other installed packages.ThanksMaximilianR forPull Request #45.
- Added an command line argument to turn of fetching (
--no-fetch). Thanks@buotoforPull Request #46. - Don't show a stacktrace anymore when stashing fails (#35).
- Fixed a bug that caused problems with submodules if the submodule had unstashed changes/ Thanks@Javex forPull Request #27.
- Fixed a bug when showing the version on Python 3#34.
- Support for Python 3 has been added. Thanks@r4ts0nforPull Request #23and@Byron for quickly merging a Pull RequestinGitPythonand releasing a new version on which this release depends.
- Now updates submodules when called from
git submodule foreach(#8).
- Fixed a problem with
setuptools 8.x(#19). - 3rd party dependencies have been updated
- Added an option to show hashes when fast-forwarding/rebasing like
git pulldoes (git-up.rebase.show-hashes). - Fixed a bug when having branches with both local tracking branches andremote tracking branches (#17).
- 3rd party dependencies have been updated to fix a problem with a 3rd partylibrary (#18).
- Fixed some typos in README and
PyGitUpoutput. - 3rd party dependencies have been updated.
ahead of upstreammessages are now cyan (seeaanand/git-up#60).- Fixed problem when using % in the log hook (#11).
- Fixed problems with the dependency declaration.
- Fix for#7(AttributeError: 'GitUp' object has no attribute 'git') introduced byv1.1.0.
Prior to v1.1.0,
PyGitUptried to guess the upstream branch for a localbranch by looking for a branch on any remote with the same name. With v1.1.0,PyGitUpstops guessing and uses the upstream branch config instead.This by the way fixes issue#6(
git updoesn't work with local only branches).Note:This change may break setups, where a local branch accidentally hasthe same name as a remote branch without any tracking information set. Priorto v1.1.0,
git upwould still fetch and rebase from the remote branch.If you run into troubles with such a setup, setting tracking informationusinggit branch -u <remote>/<remote branch> <local branch>should help.3rd party dependencies have been updated.
Allows to run
git up --versionfrom non-git dirs, too.
FinallyPyGitUp 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
-hto display a help screen (--helpwon't work, becausegitcatches this option and handles it beforePyGitUpcan do). - Added option
--versionto show, what version ofPyGitUpis running.Also checks for updates (can be disabled, see configuration). - Added option
--quietto be quiet and only display error messages.
- Fixed issue#4 (uglyexception if remote branch has been deleted).
- Fixed issue#3 (didn'treturn to previous branch).
- Fixed problem: check-bundler.rb has not been installed when installing viaPyPI (problems with setup.py).
- Incorporatedaanand/git-up#41: Support for
bundle install --localandrbenv rehash. - Fixed issue#1 (strangeoutput buffering when having multiple remotes to fetch from).
- Some under-the-hood improvements.
- Initial Release
About
A nicer `git pull`
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
