Skip to content

Pull changes without changing branch#322

Merged
geofflamrock merged 4 commits intomainfrom
pull-without-changing-branch
Aug 21, 2025
Merged

Pull changes without changing branch#322
geofflamrock merged 4 commits intomainfrom
pull-without-changing-branch

Conversation

@geofflamrock
Copy link
Owner

@geofflamrock geofflamrock commented Aug 14, 2025

Currently when pulling changes for a stack, we change to each branch that is behind the remote and run git pull on it. This isn't very efficient and can cause issues if there are changes in the working index, or if a branch in the stack is checked out in another worktree.

This PR changes the way branches are pulled:

  • If the branch is the current one we still use git pull origin {BranchName}.
  • If the branch is checked out in another worktree we use git -C {WorktreePath} pull origin {BranchName} to pull the changes in the other worktree location.
  • Otherwise we use git fetch origin {BranchName}:{BranchName} to fetch the changes directly into the branch without needing to change first.

@geofflamrock geofflamrock force-pushed the pull-without-changing-branch branch from b16dc83 to 911e46d Compare August 21, 2025 09:11
@geofflamrock geofflamrock added the minor Increment the minor version when merged label Aug 21, 2025
@geofflamrock geofflamrock force-pushed the pull-without-changing-branch branch from bdd8b05 to dbec2fd Compare August 21, 2025 22:37
@geofflamrock geofflamrock marked this pull request as ready for review August 21, 2025 22:37
@geofflamrock geofflamrock merged commit 2f91891 into main Aug 21, 2025
15 checks passed
@geofflamrock geofflamrock deleted the pull-without-changing-branch branch August 21, 2025 22:41
@geofflamrock geofflamrock added this to the 0.14.0 milestone Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant