Skip to content

Instantly share code, notes, and snippets.

@kvz
Last active October 28, 2021 11:43
Show Gist options
  • Save kvz/b205470849f0489549f43c7a27a406dd to your computer and use it in GitHub Desktop.
Save kvz/b205470849f0489549f43c7a27a406dd to your computer and use it in GitHub Desktop.
cd ~/code/uppy
git checkout main
git status
# make sure to have a clean working tree
git pull
yarn # you now have the node_modules from main, this includes the linting modules
git checkout $myBranch # e.g. `golden-retriever-ghosts-2`
git checkout main -- .eslintrc.js
git add .eslintrc.js
git commit --no-verify --message 'import .eslintrc from main'
./node_modules/.bin/eslint --quiet --fix .
git commit -am 'autofix'

Your branch now has all the linting applied was also done in main.

You could of course still get merge conflicts, but they shouldn't be due to the mass linting change that was done. So you can now run this like you would normally:

git merge main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment