I have been working a local repository synced with a GitHub repository.Recently our GitHub repository has a newly created branch release. Locally, I first run git checkout release, which seems successful, and says:Branch release set up to track remote branch release from origin.Switched to a new branch 'release'I heard that when release doesn't exist locally, git checkout release will pull from a branch also named the same as release from repository origin.So I think running git pull isn't necessary. But to my surprise, when I run git pull, it tells me that# Please enter a commit message to explain why this merge is necessary,# especially if it merges an updated upstream into a topic branch.## Lines starting with '#' will be ignored, and an empty message aborts# the commit.Why does git pull tell me it will merge? What is the reason for the merge? What shall i do then?
After checkout a new remote branch, why does pull tells me that it will merge?
git
A merge on git pull indicates that the local and remote branches have diverged. That means that there are new commits in both branches (local and remote) since the last time they were in sync.To integrate the new remote commits into your local branch without a new merge commit, kill your current git command, then run git merge --abort to abort the merge. Then run git rebase origin/release to rebase your local commits on top of the new remote commits.git pull -rwill avoid this in the future (it instructs git pull to rebase instead of merging).