Skip to content

feat: for new branches, automatically create a remote branch on first push#5

Merged
dwilding merged 1 commit intomainfrom
auto-remote
Aug 30, 2025
Merged

feat: for new branches, automatically create a remote branch on first push#5
dwilding merged 1 commit intomainfrom
auto-remote

Conversation

@dwilding
Copy link
Copy Markdown
Owner

Currently, gimmegit doesn't create a remote branch when you create a local branch. So git push doesn't work:

$ git push
fatal: The current branch snapshot0830 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin snapshot0830

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

This PR configures cloned repos so that on first push:

  • A remote branch is created (push.default = current)
  • The remote branch is set as the tracking branch (push.autoSetupRemote = true)

Here's what git push looks like with this config:

$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 14 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 971 bytes | 971.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote: 
remote: Create a pull request for 'snapshot0830' on GitHub by visiting:
remote:      https://github.com/dwilding/jubilant/pull/new/snapshot0830
remote: 
To github.com:dwilding/jubilant.git
 * [new branch]      snapshot0830 -> snapshot0830
branch 'snapshot0830' set up to track 'origin/snapshot0830'.

@dwilding dwilding merged commit 79e19b7 into main Aug 30, 2025
2 checks passed
@dwilding dwilding deleted the auto-remote branch August 30, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant