Reputation: 49054
I forked a branch (dev-v4 of bootstrap) made some changes in the new branch (patch-5). Now i have to rebase the patch-5
. How to rebase this branch?
See also: https://github.com/twbs/bootstrap/pull/18068
-- On my local machine a have already run:
git clone git://github.com/bassjobsen/bootstrap.git --branch patch-5
git checkout patch-5
Can i now add twbs/bootstrap
as my remote or should i use bassjobsen/bootstrap
?
update
Well thanks to @upandadam and after reading https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md i found i can do:
git clone git://github.com/bassjobsen/bootstrap.git --branch patch-5
git remote add upstream https://github.com/twbs/bootstrap.git
git pull --rebase upstream
git push origin patch-5
Upvotes: 1
Views: 247
Reputation: 5477
I have to address your questions in backwards order in order to answer your question.
You need to add BOTH of those repos as remotes
you need to checkout bassjobsen:patch-5
and then rebase it onto twbs:v4-dev
you then push your reslt to a new name say patch-5-rebase OR push with force argument to your bassjobsen repo git rebase <name_of_branch_to_rebase_onto>
the end result is that your work is now on-top of the remote branch.
To circle back to your last question: it really depends on your workflow whether you want 'pull' to be pulling from and telling you about your relationship with your real upstream, or if you want to be kept in the mix on the branch from your own repo. ( in case you work from another box or someone else makes a commit that they push to you etc etc.. )
After reading further, they specify this here: https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md look at step 5 of the pull requests section.
their general model is that you pull from them and you push to your own repo; and then open a pull request with them to retrieve your changes.
Upvotes: 1