Git question: Rebasing a user branch
Nicholas Krause
xerofoify@gmail.com
Tue Feb 4 22:18:00 GMT 2020
On 2/4/20 5:02 PM, Bill Schmidt wrote:
> I'm having a little difficulty with my workflow, and I'm hoping
> someone can spot the problem.
>
> I have a user branch set up with the contrib/git-add-user-branch.sh
> script. Here are the relevant portions of my .git/config:
>
> [remote "users/wschmidt"]
> Â Â Â Â Â Â Â url = git+ssh://wschmidt@gcc.gnu.org/git/gcc.git
> Â Â Â Â Â Â Â fetch =
> +refs/users/wschmidt/heads/*:refs/remotes/users/wschmidt/*
> Â Â Â Â Â Â Â fetch = +refs/users/wschmidt/tags/*:refs/tags/users/wschmidt/*
> Â Â Â Â Â Â Â push = refs/heads/wschmidt/*:refs/users/wschmidt/heads/*
> [branch "wschmidt/builtins"]
> Â Â Â Â Â Â Â remote = users/wschmidt
> Â Â Â Â Â Â Â merge = refs/users/wschmidt/heads/builtins
Not sure why but this seems fishy to me. Does merge need to be the same
as push
if your trying to avoid creating a new branch. So removing the builtins
and making
it refs/users/wschmidt/heads/* would be my guess. I'm not a git expert
through.
Nick
>
> I originally created the branch from master. I then made 15 local
> commits, and pushed these upstream.
>
> I now want to rebase my branch from master, and reflect this state
> upstream. My recipe is:
>
> git checkout master
> git pull
> git checkout wschmidt/builtins
> git rebase master
> git push --dry-run users/wschmidt +wschmidt/builtins
>
> After the rebase step, git status shows:
>
> On branch wschmidt/builtins
> Your branch and 'users/wschmidt/builtins' have diverged,
> and have 39 and 15 different commits each, respectively.
> Â (use "git pull" to merge the remote branch into yours)
>
> nothing to commit, working tree clean
>
> Looks fine to me, so lets try the force push:
>
> wschmidt@marlin:~/newgcc/gcc/config/rs6000$ git push --dry-run
> users/wschmidt +wschmidt/builtins
> To git+ssh://gcc.gnu.org/git/gcc.git
> Â * [new branch]Â Â Â Â Â Â Â Â Â Â Â Â Â wschmidt/builtins -> wschmidt/builtins
>
> Well, that's odd, why is it trying to create a new branch?
>
> If I inadvisedly attempt to push without --dry-run, I am stopped from
> creating the new branch:
>
> remote: *** Shared development branches should be named devel/*, and
> should be documented in https://gcc.gnu.org/git.html .
> remote: error: hook declined to update refs/heads/wschmidt/builtins
> To git+ssh://gcc.gnu.org/git/gcc.git
> Â ! [remote rejected]Â Â Â Â Â Â Â Â wschmidt/builtins -> wschmidt/builtins
> (hook declined)
> error: failed to push some refs to
> 'git+ssh://wschmidt@gcc.gnu.org/git/gcc.git'
>
> It seems wrong that it is trying to update refs/head/wschmidt/builtins
> (thus creating a new branch). It seems like there may be a missing
> "users/" needed someplace. But I am not at all confident that's
> correct. I'm a little suspicious of the push spec in my config.
>
> Can someone with strong git-fu give me any suggestions?
>
> Best regards,
> Bill
>
More information about the Gcc
mailing list