git - Sourcetree changes commits when merging -
i'm using sourcetree manage git. i'm trying merge branch changes (master-k) master. looks fine in each commit on branch, during merge, whole file getting changed.
note: master-k branch came user on mac, , might have used merge pull request. i'm on windows 10 using sourcetree.
here's screenshot of branch commits. note diff shown has individual lines:
and here screenshot during merge (has conflicts resolve):
you can see above diff everything in style.css.
a couple of things have tried:
the ignore whitespace problem me in past- making diffs on whole file. once found checkbox, fine. made sure off now, merge still giving me problem.
it looks you've got 2 separate issues going on here
line endings , whitespace
make sure auto whitespace set either input or auto if you're on windows. depending on if want preserve unix-style or use windows-style in working directory. both commit unix-style line endings.
then normalize line endings save headaches in future. documented, won't go here, this guide.
note changing diff style not affect files on disk or way git performs merge, changes way diff tool displays changes. recommend leaving whitespace visible because show making unnecessary changes can cause conflicts later.
dealing artifacts
your style.css file compiled sass code, technically artifact, not code proper.
whether or not include in repo largely depends on workflow , deployment process. in ideal world, you'd compile css during deployment process , not store artifacts in repo. since don't live in ideal world, i'll touch briefly on handling weirdness comes artifacts stored in repo.
when you've got artifact this, resolving merge, if successful, @ least break map data in file. compound if start producing minified versions of css well. fortunately, way deal simple, , resolve conflicts source code, re-compile artifacts , add them commit.
the sequence of actions run this:
git checkout master-k git merge master
resolve code conflicts here
npm run buildcssjob # or similar
test everything
git add style.css git commit git checkout master git merge [--no-ff] master-k
and you're done.
Comments
Post a Comment