git up does a silly thing if a feature branch is rebased on master but not force-pushed yet.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 539
- Forks
- 45
- Avg merge
- 7d 4h
- Merged PRs (30d)
- 1
Description
If I work on my personal feature branch that I periodically rebase on master and force-push into origin, and I accidentally do git up after rebasing but before force-pushing, the result is weird and confusing: git up rebases local feature on remote feature, which produces rebased copies of all new commits in master.

Maybe it could be possible to try and detect such situation and at least warn that something weird is going on? For example, check if there are local/remote branches that we will be leaving behind after rebase?
Or, I don't know, if that would bring a lot of complications and slow down operation for everyone, while addressing a relatively unusual workflow, oh well, at least if someone else stumbles upon it, they'll see this issue here.
This shell script reproduces the problem:
#!/bin/sh
set -euxo pipefail
rm -rf remote/ local/
git init remote
echo a >> remote/a.txt # this file will be modified on remote
echo b >> remote/b.txt # this file will be modified on local
git -C remote add a.txt b.txt
git -C remote commit -am "0"
echo a >> remote/a.txt
git -C remote commit -am "1"
git clone remote local
git -C local checkout -b feature
echo b >> local/b.txt
git -C local commit -am "feature"
git -C local push --set-upstream origin feature
echo a >> remote/a.txt
git -C remote commit -am "2"
echo a >> remote/a.txt
git -C remote commit -am "3"
echo a >> remote/a.txt
git -C remote commit -am "4"
git -C local up # OK, updates master
git -C local rebase master
git -C local up # rebases local/feature on remote/feature, producing rebased versions of commits 2-3-4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the shell-script reproduction in the issue and inspect the code path used by git up when a local branch has been rebased but its remote branch has not been force-pushed. Trace how the branches are compared before the rebase. Done means this workflow no longer silently produces confusing rebased copies, or clearly warns the user before proceeding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100