Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cant create new remote branch by pushing local branch #726

Closed
AlexW0lf1 opened this issue May 22, 2024 · 2 comments
Closed

[Bug]: Cant create new remote branch by pushing local branch #726

AlexW0lf1 opened this issue May 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AlexW0lf1
Copy link

AlexW0lf1 commented May 22, 2024

Describe the bug

Running Git: Push -> choose remote origin -> choose branch
I see existing branches in format:
origin/new
origin/main

I'm working in local branch "another_branch"
My intention is to create new branch on remote origin with the same name

Tried to type "another_branch", "origin/another_branch", "origin another_branch", "origin@another_branch"
All failed to push
1
2

It says "Select or create the new branch by typing its name and selecting it", so there should be a possibility to create new remote branch while pushing. I just cant figure out the way I should specify it.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

Uncaught (in promise) Error: Pushing to https://xxx/temporary.git
error: src refspec another_branch does not match any
error: failed to push some refs to 'https://xxx/temporary.git'

    at Object.action (plugin:obsidian-git:29441:25)
    at PluginStore.exec (plugin:obsidian-git:29466:25)
    at eval (plugin:obsidian-git:26971:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (plugin:obsidian-git:26969:16)
    at GitExecutorChain.eval (plugin:obsidian-git:26953:44)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:obsidian-git:25798:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce

1.Clone existing repository via git
2. Open folder as Obsidian vault
3. Push changes to new branch

Expected Behavior

Git: Push -> Choose "origin" -> enter name for a new branch

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

2.24.1

@AlexW0lf1 AlexW0lf1 added the bug Something isn't working label May 22, 2024
@AlexW0lf1
Copy link
Author

Pushing from main to remote branch main works correctly. I think problem is that I cant set upstream branch for the new branch, because it doesnt exist on remote yet

@AlexW0lf1
Copy link
Author

It was my mistake, I used different names for local and remote branches. Plugin works as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant