0

I have one project and I try to sync code.

1st off I run:

git pull origin master

and got several conflicts:

Auto-merging mobile/www/img/meeting_details/attending_buttons_yes.png
Auto-merging mobile/www/css/group-details.css
CONFLICT (add/add): Merge conflict in mobile/www/css/group-details.css
Auto-merging mobile/platforms/ios/www/img/meeting_details/attending_buttons_yes.png
Auto-merging mobile/platforms/ios/www/css/group-details.css
CONFLICT (add/add): Merge conflict in mobile/platforms/ios/www/css/group-details.css
Auto-merging mobile/platforms/android/assets/www/img/meeting_details/attending_buttons_yes.png
Auto-merging mobile/platforms/android/assets/www/css/group-details.css
CONFLICT (add/add): Merge conflict in mobile/platforms/android/assets/www/css/group-details.css

I don't care about my changes only in CSS folder so like in SVN I removed all css files:

rm -rf mobile/www/css/*.css

After, I run once more:

   git pull origin master

I expected to restore above mentioned files back but got:

U   mobile/platforms/android/assets/www/css/group-details.css
M   mobile/platforms/android/assets/www/img/meeting_details/attending_buttons_yes.png
U   mobile/platforms/ios/www/css/group-details.css
M   mobile/platforms/ios/www/img/meeting_details/attending_buttons_yes.png
U   mobile/www/css/group-details.css
M   mobile/www/img/meeting_details/attending_buttons_yes.png

As I understand U means Update, M - merge.

But My css folder is empty

I deleted local files to prevent conflicts but sounds like I do something wrong

Please help,

snaggs
  • 5,543
  • 17
  • 64
  • 127
  • possible duplicate of [Retrieve missing files from remote repo?](http://stackoverflow.com/questions/9828076/retrieve-missing-files-from-remote-repo) – Maxime Lorant Jun 08 '14 at 12:44

2 Answers2

1

Do you want your local files to be exactly the same as the remote master branch? If so, you can use:

git reset --hard origin/master
Simon
  • 1,416
  • 1
  • 15
  • 24
1

First, make sure git config core.autocrlf is set to false, or git will try to add wrong eol style (LF or CRLF) where it should not.

Second, anything done "like SVN", when talking about Git, is likely to not go your way.
Git is designed very differently from SVN.

I don't care about my changes

Then:

git checkout origin/master -- .

(or git reset --hard, as suggested)

See also "How to handle/fix git add/add conflicts?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250