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

New hub sync command to update local branches #1265

Merged
merged 4 commits into from
Sep 12, 2016
Merged

New hub sync command to update local branches #1265

merged 4 commits into from
Sep 12, 2016

Conversation

mislav
Copy link
Owner

@mislav mislav commented Sep 12, 2016

Ported from my bash version.

Here was it in action: https://twitter.com/mislav/statuses/677091160482054144

Unlike GitHub Desktop, the sync command doesn't ever push any branches. It only deals with incoming changes from upstream. Should it be pushing branches?

Fixes #906, fixes #618

Since the test commits are empty and had identical commit messages, two
commits with the same parent could end up having identical SHAs. To
avoid that, generate a unique message for each empty commit.
@prologic
Copy link

I still don't see git sync / hub sync (I have alias git=hub) deleting local branches that have been merged into origin/master or in my case upstream/master

What am I missing? I'm working with the "forking model" where upstream is the upstream repro and origin is my fork.

@mislav
Copy link
Owner Author

mislav commented Jan 19, 2020

@prologic hub sync doesn't yet do a great job of cleaning up merged branches in the triangular model (i.e. fork vs. upstream). It mostly handles that in the single-repo workflow.

But just to check: did you delete your branches on origin after they were merged into upstream/master? hub sync will only delete a merged branch if it finds that its push target (in your case, origin/mybranch) was deleted.

@prologic
Copy link

But just to check: did you delete your branches on origin after they were merged into upstream/master? hub sync will only delete a merged branch if it finds that its push target (in your case, origin/mybranch) was deleted.

Looks like I wasn't doing this by looking at the Github UI. But then again I'm not sure Github is able to do this automatically either? Anyway I enabled the option in the UI and deleted old branches. Let's see... :)

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.

Add command to clean all merged branches GitHub for Mac style sync?
2 participants