connect my local git repository with github forked repository? -
i created private & local repository using git clone --bare $upstream
(detailed here how create git repository on server github server?)
at time, didn't think contributing original github repo. ($upstream)
, found out pull requests possible github repository.
so question how can contribute original github repo?
i wonder if following strategy possible:
- i create github fork $upstream (the original opensource github repo)
- somehow teach local repo new github fork(as did
git remote add
)- create branch(mywork) on local clone, work, , push new github fork
- pull requests original repo auther.
edit
since there many modifications(commits) in private repo,
i need way go current $upstream's clean state(upstream's master without local modification made in origin/master , not in mywork).
(so pull request doesn't have modification except branch(for pull request))
how can that?
took me long time figure out..
there's cherry-pick
command in git perfect situation.
send pull request on github latest commit
basically,
git checkout -b mywork_for_pull_request upstream/master (make branch off upstream/master not origin/master) git cherry-pick `sha-of-mywork-branch's-commit` (pick out commits want contribute) git push mygithub_fork mywork_for_pull_request
and press pull request
in github page.
Comments
Post a Comment