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

GitHub for Mac style sync? #618

Closed
AjayMT opened this issue Sep 14, 2014 · 3 comments · Fixed by #1265
Closed

GitHub for Mac style sync? #618

AjayMT opened this issue Sep 14, 2014 · 3 comments · Fixed by #1265
Labels

Comments

@AjayMT
Copy link

AjayMT commented Sep 14, 2014

Perhaps we could have a hub sync command that performs the equivalent of pressing the 'Sync' button in the GitHub for Mac app? I can implement this once I know exactly what the Sync button does. According to the GitHub for Mac FAQ:

We do the equivalent of a git pull --rebase (but make sure to never rewrite merges).

Maybe hub sync can simply do something like git pull --rebase=preserve. Or we could wrap git pull and add a --sync option that does the same thing.

Does anyone else think this would be a nice feature to have? Any ideas/thoughts?

@AjayMT AjayMT changed the title GitHub for Mac style sync? Feature Request: GitHub for Mac style sync? Sep 14, 2014
@AjayMT AjayMT changed the title Feature Request: GitHub for Mac style sync? Feature request: GitHub for Mac style sync? Sep 14, 2014
@mislav
Copy link
Owner

mislav commented Sep 15, 2014

👍 Very good idea. This project might become GitHub official CLI tool and having the same operations as the ones in the desktop app is a win for the user in my opinion.

@dannygreg What is even a "sync" on Mac?

@mislav
Copy link
Owner

mislav commented Sep 16, 2014

@jspahrsummers explains what is a "Sync" on Mac. It's some serious magic using libgit2, but it boils down to:

  1. git fetch
  2. git rebase (if needed) or git merge (if a rebase would result in conflicts)
  3. git push (if no conflicts occurred)
  4. Fast-forward branches other than just the current one

@mislav mislav added the feature label Sep 16, 2014
@AjayMT
Copy link
Author

AjayMT commented Sep 17, 2014

Interesting... I'm still trying to figure out whether this is something we can do by only wrapping git commands (i.e something we can do without having to use libgit2/rugged or some other git library).

Accomplishing step 2 (git rebase or git merge based on conflicts) seems like the biggest challenge right now.

@mislav mislav changed the title Feature request: GitHub for Mac style sync? GitHub for Mac style sync? Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants