-1

First of all i am not much familiar with GIT so some of you find it stupid question than i am really sorry for wasting of your time.

I am getting conflict in whole module when i did git pull.

That module was previously on .gitignore but after that we have decided to add it in a git repo. so we removed ignore entry for "web/membership". so my friend add that folder in git repo and when i did git pull i am getting conflict on whole module. i know after conflict you can not use checkout to get remote changes but is there any other way to get remote changes ? my local version is old but only for web/membership.

[hardik@abc abc]$ git checkout web/membership
web/membership/.htaccess: needs merge
web/membership/application/.htaccess: needs merge
web/membership/application/cache/.htaccess: needs merge
web/membership/application/cache/index.html: needs merge
web/membership/application/config/autoload.php: needs merge
web/membership/application/config/config.php: needs merge
web/membership/application/config/constants.php: needs merge
web/membership/application/config/database.php: needs merge
web/membership/application/config/doctypes.php: needs merge
web/membership/application/config/foreign_chars.php: needs merge
web/membership/application/config/form_validation.php: needs merge
web/membership/application/config/hooks.php: needs merge
web/membership/application/config/index.html: needs merge
web/membership/application/config/migration.php: needs merge
web/membership/application/config/mimes.php: needs merge
web/membership/application/config/profiler.php: needs merge
web/membership/application/config/routes.php: needs merge
web/membership/application/config/smileys.php: needs merge
web/membership/application/config/user_agents.php: needs merge
and so on..

now its not possible to solve conflict in these number of files so how can i solve this issue ? remote version is latest.

Thank you for reading this question.

4

2 回答 2

0

Try git mergetool -y it will save few keystroke while merging files

于 2013-07-08T09:41:23.050 回答
0

git pull is a kind of shorthand for git fetch plus git merge.

Maybe you do not want to merge. So you could simply fetch the commits from remote

git fetch --all

(--all is not mandatory but I usually want all new commits)

and after that reset your local branch to the remote. That way you'd "loose" you local changes on that branch.

git checkout <branch>
git branch temp
git reset --hard origin/<branch>

The second command creates a new branch on the HEAD of your local branch without checking it out. That way, the commits from your local branch will not get lost, when you reset the local branch to the remote and you can always return to that point in case you're not happy.

于 2013-07-08T09:58:42.220 回答