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

Forking, Updating #1368

Closed
svkamp opened this issue Jan 1, 2017 · 3 comments
Closed

Forking, Updating #1368

svkamp opened this issue Jan 1, 2017 · 3 comments

Comments

@svkamp
Copy link

svkamp commented Jan 1, 2017

So... lets see if i got this right....

hub clone name/repo
cd repo
hub fork (creates a fork of name/repo to myname/repo

adds an origin for both...

so... how does one pull updates from the origin, and apply them to the fork then push them to myname/repo ???

its a bit confusing

@mislav
Copy link
Owner

mislav commented Jan 4, 2017

Hub encourages the "triangular" workflow with git, where you fetch from one remote (hub calls it "origin" by default, but some people name it "upstream") and push it to another remote (typically your fork).

Therefore:

# fetch latest "master" branch from upstream:
$ git fetch origin master

# merge in latest upstream updates to your "feature" branch:
$ git merge origin/master

# push your "feature" branch to your fork:
$ hub fork
$ git push -u svkamp HEAD

# open a pull request with these changes:
$ hub pull-request

@mislav mislav closed this as completed Jan 4, 2017
@waldyrious
Copy link

waldyrious commented May 23, 2017

@mislav it looks like @svkamp was asking about the particular task of updating a fork with changes from upstream, rather than about the generic triangular workflow.

I'd say this would be equivalent to running hub sync with the additional step (which you alluded to in #1265) of pushing the updated branches to the fork's remote (e.g. git push --all waldyrious).

I suppose adding a --push option to hub sync to push the branches would address this use case.

@mislav
Copy link
Owner

mislav commented May 23, 2017

@waldyrious If you'd like to propose enchancements to the hub sync command, please open a new issue, detailing how you think the feature could work. For instance: should it only push already published branched, or push even unpublished ones too?

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

No branches or pull requests

3 participants