Reputation: 1159
I have two branches in my project, one is develop and other is master, accidently without merging develop into master I made app live and now I have two different versions on two different branches. Let's say 1.5 version on master and 1.6 on develop, now when I tried to merge these two branches git show merge conflicts in 3 different files,
after merge when I tried to open xCode project, it failed and show error "project cannot be load.." when tried to open files manually it just doesn't open in editText. I tried sublime editor but then again I couldn't locate conflict as there were a lot of lines of code.
Upvotes: 3
Views: 3484
Reputation: 116
Hello @Najam you can make change in remote branch push it to master and then try to merge remote and master
git merge remote mater:master
or you can delete the remote branch and push your remote code to master branch.
Upvotes: 1
Reputation: 18002
You can resolve conflicts by keeping any version (keep mine or keep theirs) of this files as they save the xcode status but they don't have your code and should not have been tracked. But don't resolve the conflicts yourself, just choose one of the versions and the project should work.
You are having this problem because you should have created a .gitignore file in your repo before creating any other file to avoid having problems with files that your ide uses but don't have the code of your app.
To avoid problems from now on, you can create the git ignore file with this content and add it to the repo.
But there are files traked that should not be. So execute this commands:
git rm -r --cached .
git add .
git commit -m "use .gitignore file"
This will delete everything from the index and add the files again applying the gitignore rules.
Check that all is working and git push
to your server and you should not have more conflicts with this files for saving the xcode status.
Upvotes: 1
Reputation: 1323065
If you want to replace master content with dev, you should:
That is:
git checkout dev
git merge --ours master
git checkout master
git merge dev
Upvotes: 4