altsem / gitu

A TUI Git client inspired by Magit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: create branch on origin when pushing new branch

mattgallagher92 opened this issue · comments

Thanks for sharing gitu, I love it so far!

When I'm working on a branch that only exists in my local repo and use Magit to push, Magit handles creating the new branch at the destination and setting that branch as the upstream of my local branch. I'd like gitu to do the same.

Title should probably say "on remote" rather than "on origin"

Could be the start of #58

Yeah I think this will be a good starting point, I also find this feature useful

@mattgallagher92 You probably want to add

[push]
	autoSetupRemote = true

to your ~/.gitconfig so git will always create a new branch on remote when pushing

Thanks @golden-expiriensu! That doesn't quite seem to do what I wanted. However, that prompted me to look through the docs more closely, and setting push.default to current gives me the behaviour that I want 😁 I can then just run a git push (either directly or via gitu) and the branch is created on origin.

@altsem given that this seems to be behaviour that's configurable within Git, gitu should probably respect the Git config. Perhaps that means that there's no need for gitu to change its behaviour (up to you).

An easier solution could be to document Git config in a "Migrating from Magit" section somewhere. I'd be happy to contribute a README PR.

What course of action do you think is best?

Magit does give you a prompt I believe instead of just outright failing, I still think there's value in that!

https://magit.vc/manual/magit/The-Two-Remotes.html

@mattgallagher92 Im still thinking that Gitu could use a user guide. Haven't decided much on how it should look like. But perhaps it's just a matter of giving the README some structure and adding some tips & tricks (like this one).

Feel free to open a PR if you like. I'm open to ideas! :)

edit: I made a simple note in the README with a link to push.default.

Sorry for the delay! The README is great 🙂 happy for you to close this unless you think that there's anything else of value being tracked here

P.S. gitu is really coming on in leaps and strides - thanks! I'm so pleased that it exists 😁

Magit does give you a prompt I believe instead of just outright failing, I still think there's value in that!

https://magit.vc/manual/magit/The-Two-Remotes.html

Think this is left just.