As long as it is not fast-forward, it will automatically merge after the pull, and each merge will generate a commit record.
Solution:
If your repo is just later than the trunk and there are no different commits, then it is fast-forward。这时候先pull. At this time, first pull to the local computer and merge it with the local content. This situation will not generate additional commit records. Then push the local code to your remote repo.
If the fast-forward条件,那么需要pull --rebase到本地,并完成rebase操作。成功后再push conditions are not met, you need to pull --rebase to the local computer and complete the rebase operation. After success, push to the remote repo.
Attachment: A piece of information on "How to ~~rebase~~ rebase": https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request
If you do nothing on your branch, then whether it is rebase or merge, your branch will be the same as A's head, without an extra commit.
Of course, if you change something yourself, it will never be completely synchronized, otherwise you will have to work hard with the version control system.
But the difference between rebase and merge is that merge will create a new change at this point, while rebase just connects your change history on this branch to the history of A, without a new changelog.
As long as it is not
fast-forward
, it will automatically merge after the pull, and each merge will generate a commit record.Solution:
If your repo is just later than the trunk and there are no different commits, then it is
fast-forward
。这时候先pull
. At this time, firstpull
to the local computer and merge it with the local content. This situation will not generate additional commit records. Then push the local code to your remote repo.If the
fast-forward
条件,那么需要pull --rebase
到本地,并完成rebase
操作。成功后再push
conditions are not met, you need topull --rebase
to the local computer and complete therebase
operation. After success,push
to the remote repo.Attachment: A piece of information on "How to ~~rebase~~ rebase": https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request
So you have to use rebase...
If you do nothing on your branch, then whether it is rebase or merge, your branch will be the same as A's head, without an extra commit.
Of course, if you change something yourself, it will never be completely synchronized, otherwise you will have to work hard with the version control system.
But the difference between rebase and merge is that merge will create a new change at this point, while rebase just connects your change history on this branch to the history of A, without a new changelog.