I would like the topic branch to be updated with the parent branch. This works great with a local theme branch using rebase for the parent branch:
git checkout topic git rebase master
However, if the topic is a remote branch, then it seems that reinstalling for management conflicts with checking the remote branch.
What is the best way to keep up with the changes in the main thing in the remote branch.
That's what I'm doing. It seems that I always encounter several conflicts and several βbranchesβ when reinstalling remote branches for management.
I use the standard design when working with remote branches:
git checkout master git checkout -b topic git push origin topic git branch --set-upstream topic origin/topic
I continue to work on the topic, commit and click on the origin.
At some point, the wizard was updated, and I need to include these changes in my topic thread.
git checkout master git pull git checkout topic git rebase master
Great. Now click this update.
$ git push To git@github.com :duane/branchtest.git ! [rejected] topic -> topic (non-fast-forward) error: failed to push some refs to ' git@github.com :duane/branchtest.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
Curiously, the log looks something like this:
$ git log --graph --format=oneline * 31f4b133a4a9983528ba309e6c161e09e8061f84 Change 1 for topic 2. * 2dc45b91856748a9c6adaf3579a7b8b2cf90a6ae Change 3 for file1. * db97959ec75267bf94d97af6e8b2a8a762c61b25 Add topic2.txt. * 08e6cc4b14a23dad86c2d283ee4acc1cebc775ef Change 2 for file1. * e707b9571b2aa4d01073f156abb407fec15a195a Change 1 for file1. * 2002670efda4d8c83150a4cc1c25fac62e37814d Add file1.txt. * d3a6eae43e4824f455872622491c2ca861f96d4f Begin the repo. $ git pull Merge made by recursive.
And after that it looks like
$ git log --graph --format=oneline * 18ba5265e2836e1a7884341dbedb8b2cc8ab9727 Merge branch 'topic' of github.com:duane/branchtest into topic |\ | * 0e5f3022c7f087ed4dd70d11a0cba250300be05e Change 1 for topic 2. * | 31f4b133a4a9983528ba309e6c161e09e8061f84 Change 1 for topic 2. * | 2dc45b91856748a9c6adaf3579a7b8b2cf90a6ae Change 3 for file1. |/ * db97959ec75267bf94d97af6e8b2a8a762c61b25 Add topic2.txt. * 08e6cc4b14a23dad86c2d283ee4acc1cebc775ef Change 2 for file1. * e707b9571b2aa4d01073f156abb407fec15a195a Change 1 for file1. * 2002670efda4d8c83150a4cc1c25fac62e37814d Add file1.txt. * d3a6eae43e4824f455872622491c2ca861f96d4f Begin the repo.
Change 1 for topic 2 was the change I made. It is now listed twice.
The course path ends with this mess in my deleted topic thread.
An even bigger problem is that this extra merge point is repeated every time a switch to master occurs; even without changes on the main server!
Where am I wrong? How can I keep abreast of the leading branch while keeping the remote branch?