I'm new to Git. and there's something embarrassing that keeps happening to me every time i want to commit my changes and do a pull request. when i update my local branch from master using "merge" and try to commit my changes, the updates which i have merged into my branch appear when i want to push my local changes into the master. And appears in my pull request, which I'm not able to merge with the master branch because it will conflict together and rewrite existing code. Please help
Asked
Active
Viewed 385 times
0
-
Answering the question in the title: They're not. What you're doing is running `git pull`; that means *run `git fetch`, then run a second Git command, by default `git merge`*. The `git merge` step is *merging* their commit, adding a new merge commit in *your* branch. So *you* are doing this by running `git pull`. Consider learning the commands that `git pull` runs for you. – torek May 09 '22 at 15:59
-
Once you understand both `git merge` and `git rebase`, you can choose whether you want to use `git rebase` *instead of* `git merge`. (Or maybe you want something else entirely, although these two are by far the most commonly desired commands.) You can then instruct `git pull` to use `git rebase` as its second command, if you prefer to use one command instead of two. (I usually prefer to use two separate commands myself.) – torek May 09 '22 at 16:00