-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Gracefully handle branch not having an upstream #90
Comments
@sindresorhus you could also default upstream to master. git branch --set-upstream-to=origin/master master |
@sindresorhus What happens if you push the changes to git without upstream? Does it work? |
@SamVerschueren No:
|
@DylanPiercey I don't want to default to master. Let's say I have a local repo with no upstream, that I want to publish to a private npm account. |
@sindresorhus So this means that the |
Hmm, yeah. Maybe this is too much of an edge-case? |
If that is your use case and this would fix it, don't see any problem of adding that check. |
IMO, if we do this, we should guard against accidental use in some way. I can totally see myself cranking out a quick small module and forgetting to setup the GH repo. We could either:
|
Did any resolution come out of this? |
I am facing the same issue while trying to push from my branch ✔ Prerequisite check
❯ Git
✔ Check local working tree
✖ Check remote history
→ fatal: no upstream configured for branch 'plugins' I do have a master and use that for the stable versions, while I am using the branches for prereleases. This way any big bug can be fixed easily and quickly from master (master is always clean and production ready), while I can experiment in my branch and publish minor versions for testing. But unfortunately with this bug I cannot use Using: np --any-branch |
Hopefully I didn't break anything, but this was fixed on my case with: git branch --set-upstream-to origin/plugins Since I am pushing from the local branch |
@issuehuntfest has funded $60.00 to this issue. See it on IssueHunt |
@sindresorhus how about a |
Another way of handling this could be to prompt the user, asking whether they'd prefer to skip the push step or enter a branch name that would later be used for pushing. |
@Norris1z Adding a new flag should be the last option. We don't add flags lightly. Better to find a way to handle it automatically. |
I don't think prompting is worth it here. Not having an upstream might be intentional. I think skipping is better. If the user really wants to push, they should just set an upstream. |
@itaisteinherz has submitted a pull request. See it on IssueHunt |
@sindresorhus has rewarded $54.00 to @itaisteinherz. See it on IssueHunt
|
The above should not fail. The task should just be marked as skipped.
The text was updated successfully, but these errors were encountered: