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

Push local branch with --set-upstream #116

Merged
merged 2 commits into from
Aug 30, 2023
Merged

Push local branch with --set-upstream #116

merged 2 commits into from
Aug 30, 2023

Conversation

nikostoulas
Copy link
Contributor

📝 Description

Resolves #115

@nikostoulas nikostoulas requested a review from a team as a code owner August 29, 2023 12:55
@@ -51,6 +51,6 @@ def create(self, tone: MessageTone, jira=None, include=None, edit: Optional[int]

title = reviewed_message.split("\n")[1]
description = reviewed_message.split(title)[1]
git.push("origin", git_info.branch, force=True)
git.push("origin", git_info.branch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--force was added so that we can easily override the remote with rebased/amended commits in case of g pr --edit X or g pr on an already pushed branch with the same name in github.

We had discussed setting this in the configs too but defaulting to True would make, again, more sense to me since developers commonly rebase or amend their commits before merging their work to the main branch.

We don't need to disable the force flag to resolve the reported issue, do we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap we don't need to. Personally I would rather be asked if something is going to be forced in remote but no strong opinion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this issue so that we support that in the context of v1; let's develop them separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

Comment on lines +96 to +98
sh.git("push", "--set-upstream", remote, "--force", branch)
else:
sh.git("push", remote, branch)
sh.git("push", "--set-upstream", remote, branch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -51,6 +51,6 @@ def create(self, tone: MessageTone, jira=None, include=None, edit: Optional[int]

title = reviewed_message.split("\n")[1]
description = reviewed_message.split(title)[1]
git.push("origin", git_info.branch, force=True)
git.push("origin", git_info.branch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this issue so that we support that in the context of v1; let's develop them separately.

@nikostoulas nikostoulas changed the title Push local branch with --set-upstream instead of force Push local branch with --set-upstream Aug 30, 2023
@nikostoulas nikostoulas merged commit 8f040d5 into main Aug 30, 2023
@nikostoulas nikostoulas deleted the update-git-push branch August 30, 2023 08:15
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.

Link local branch with remote branch when creating a pr
2 participants