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

Automatically set upstream branch when creating local branch based on an origin one #127

Closed
bjrne opened this issue Aug 4, 2017 · 2 comments

Comments

@bjrne
Copy link

bjrne commented Aug 4, 2017

Currently, when selecting "Create new branch and switch to it", I have to set an upstream branch manually again. Maybe this is intended behaviour, but I think in 99% I'd want to push to the same branch again or locally explicitly create another, differently named branch in order to avoid confusion.

@bjrne bjrne changed the title Automatically set upstream branch when creating local branch based one from origin Automatically set upstream branch when creating local branch based an origin one Aug 4, 2017
@bjrne bjrne changed the title Automatically set upstream branch when creating local branch based an origin one Automatically set upstream branch when creating local branch based on an origin one Aug 4, 2017
@j4yk
Copy link
Collaborator

j4yk commented Aug 4, 2017

Hmm, when you checkout -b a new branch in Git, it does not have an upstream configuration. There are two intended use cases for "create branch and switch to it": 1) loading that commit temporarily to have a look at it—should not need an upstream branch—and 2) branch off from a commit that might not be the tip of the current branch—should get a new upstream setting because this is a new branch (as in "stream of development") after all.

How are you using the feature?

EDIT: nevermind, I mixed that up with "Switch to this commit on a new branch"

@j4yk
Copy link
Collaborator

j4yk commented Aug 4, 2017

When creating a local branch from a remote tracking one, you are probably correct. Checking out remote tracking branches in Git also creates a new local branch that is automatically set up to track the same remote branch.

@j4yk j4yk added this to the release 0.6.0 milestone Oct 29, 2017
j4yk added a commit that referenced this issue May 27, 2018
Although they are not used during fetches yet.
@j4yk j4yk closed this as completed in f3c21ad May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants