gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

upstream integration in git butler CLI

Open UeberTimei opened this issue 8 months ago • 3 comments

I have a branch. I work with a colleague on the same branch. He commited something on the branch in a remote repo. I want to pull this change to my local branch. but pull pulls changes in relation to target-branch, not the branch we're working on. If I try to push changes into the remote repo my last commit will delete a commit made by my colleague and push my changes into the remote repo, as I understood what but wanted to do.

I know only the solution is that you need to teardown butler and pull changes by yourself.

Please, add a feature that can integrate upstream changes into my local branch.

UeberTimei avatar Mar 31 '26 19:03 UeberTimei

I want to support this feature request wholeheartedly!

Actually, this became a actual problem for me a few days ago, as I did some changes within the GitLab IDE after I've pushed a gitbutler branch to it.

Gitbutler really plays into my development style, and I'm liking it a lot so far! As I'm developing exclusively on a VM via SSH (vscode), I'm exclusivly using the GitButler CLI. And I actually like using it (more of a CLI than a GUI person anyway).

To get around this problem, I had to copy over the whole local repo dir to my local machine, spin up the GitButler GUI, do the upstream integration in the GUI and then copy/replace the whole repo dir to/on the server again...

The most aggreviating thing (for me) was that I could see clearly the new remote commits in the but status output stacked on top of my local branch, but, alas, I could not for the life of me figure out how to integrate these into my local branch via the CLI... Online, I could not find any helpful information on this topic other than the manual on upstream integration via GUI.

Maybe I was just not able to find a CLI solution, or there is none, But I would greatly appriciate even a very simple replace/stack on top command in the CLI!

Fiech avatar Apr 03 '26 02:04 Fiech

Thanks a lot for reporting, and sorry for the hassle.

I don't think the upstream integration story is very mature in the CLI right now. The reason for this is probably that the upstream integration implementation is up for a complete overhaul.

Byron avatar Apr 08 '26 09:04 Byron

This is now supported by but branch update <branch>, added in https://github.com/gitbutlerapp/gitbutler/pull/14097 and released in 0.20.1.

It integrates the branch's tracked remote changes into the local branch. The default is pull-rebase; --strategy also supports smart-squash, merge, and pick-remote, and --dry-run previews the result first.

krlvi avatar Jul 19 '26 19:07 krlvi