Why do I always have to merge manually on git pull?

I am a new user of git and can’t figure out how to get around this. I have had some experience with SVN and am going by SVN behavior.

Any time I pull files from remote repository, and the file I have modified are also modified remotely, it needs merging. I can understand merge conflicts for complex changes, but I am seeing merge conflicts for very small (e.g. one line change in different functions) changes. As far as I remember, SVN could merge most of it automatically and will put the file in conflicted state only if automatic merge failed.

  • Using git for version control
  • Pushing into multiple remote repositories simultanously in IntelliJ
  • Aptana Git plugin standalone
  • How to git svn fetch only branches/tags with certain patterns?
  • Which git branch was this branch checked out from?
  • Why does Git automatically ignore most Node files?
  • For git, it seems to be happening every time and forcing to open the git merge tool. Is there any way to automatically merge the files? Am I missing some setting that is basically putting the repository in conflicted set by default?

  • Managing hackage releases
  • Git: How can I put a commit between older commits without changing the files/folders of later commits?
  • How to git clone a specific tag only without getting the whole repo?
  • GIT: modify contents of the secondlast pushed commit
  • Git remove last commits from remote made by someone else
  • Make git highlight tab characters in a diff?
  • 2 Solutions collect form web for “Why do I always have to merge manually on git pull?”

    A common cause of this is differing line endings. Are you sharing a repo with someone else using a different OS? SVN does some munging of line endings. Git, on the other hand, stores files byte-for-byte exactly as they are by default. That means that when a Windows user saves a file with \r\n line endings and a Linux user saves the file with \n line feeds, every line appears changed, and if any other changes are in play, it causes conflicts everywhere. To change the way line endings are handled, use the configuration setting “core.autocrlf”. In a repo where different OS’s are in play, I recommend setting it to “input” for Linux users and “true” for Windows users:

    git config [--global] core.autocrlf input


    git config [--global] core.autocrlf true

    Actually, I’d say just use these settings globally all the time. They’ll save you some heartache. Read more about core.autocrlf on the git-config man page, and note that if you’re suffering from this problem and you turn autocrlf on with an existing repository, you may see some startling behavior, but it can be explained.

    From the manual:


    git commit -a

    At this point the two branches have diverged, with different changes
    made in each. To merge the changes made in experimental into master,

    git merge experimental

    If the changes don’t conflict, you’re done. If there are conflicts,
    markers will be left in the problematic files showing the conflict;

    git diff

    will show this. Once you’ve edited the files to resolve the conflicts,

    git commit -a

    will commit the result of the merge. Finally,


    will show a nice graphical representation of the resulting history.

    Q: What Git client are you using? The Git command line tool? Or something else?

    Q: Also, are the files in question both Linux, or both Windows? Or are they from different environments?

    Git Baby is a git and github fan, let's start git clone.