http://stackoverflow.com/questions/18612093/applying-remote-changes-onto-local-git-pull-overwrites-files-another-way-thanthis
Under [branch "master"]
, try adding the following to the repo's Git config file (.git/config
):spa
[branch "master"]
remote = origin
merge = refs/heads/master
This tells Git 2 things:code
- When you're on the master branch, the default remote is origin.
- When using
git pull
on the master branch, with no remote and branch specified, use the default remote (origin) and merge in the changes from the master branch.
I'm not sure why this setup would've been removed from your configuration, though. You may have to follow the suggestions that other people have posted, too, but this may work (or help at least).orm
If you don't want to edit the config file by hand, you can use the command-line tool instead:ip
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
Git doesn't work on individual files. I'm not aware of the remote_cache
setting so I can't comment on that. However, in git, you have to clone
the entire repository, make a change to a file(s), commit it (this is a local operation) and then push the changes back.ci