Suppose following scenario.
Then, if I issue git status
command, I see that a lot of changes (which I think were done by other people in step 3) which I didn't do are automatically staged for next merge commit which I am going to do after I resolve conflicts.
My question is, after conflict resolving and committing, does above mentioned changes which were staged but not done by me go to the repo as if they were done by me?
Often, merge conflicts happen when people make different changes to the same line of the same file, or when one person edits a file and another person deletes the same file. You must resolve all merge conflicts before you can merge a pull request on GitHub.
A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help.
Every time you do a merge, a commit is created . Doing pull is effectively fetch and merge operation (unless you are fast forwarding).
When a merge is successful without any conflicts, you see a direct commit (given you are not fast forwarding). But when a coflict occurs, git leaves the files in coflict in a conflicted state. All other files which are merged succcessfully are placed in staged area. So when you finish your conflict, you can commit all the files together.
This commit is marked as a merge commit and other person reading the history in future should make out that this commit was caused by the merge and not for changes made by you.
This normally happens if you haven't disabled some settings in your git config
The autocrlf option when this option is enabled and you pull something your line endings will be changed (if they are different) and your files are modified.
autocrlf = false
# or with this
git config --global core.autocrlf true
The next one is the filemode here its the same
filemode = false
Normally that are the problems. You can set these options in your git config file
.git/config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With