Skip to content

Instantly share code, notes, and snippets.

@omnibrain
Last active April 15, 2020 12:11
Show Gist options
  • Save omnibrain/a705a02f2d0503bfa5465738443f398e to your computer and use it in GitHub Desktop.
Save omnibrain/a705a02f2d0503bfa5465738443f398e to your computer and use it in GitHub Desktop.
  1. Sicherstellen, dass die neuste Version der git-hooks installiert ist (siehe README vom git-hooks Repository)
  2. cd /path/to/investmentcockpit
  3. develop branch pullen: git checkout develop && git pull
  4. Feature branch auschecken, der noch nicht formatiert ist: git checkout feature/I5-1337-my-cool-feature
  5. rebasen auf den letzten commit auf dem develop branch, der noch nicht formatiert ist: git rebase 031c0e11f9a
  6. Konflikte resolven (im IntellliJ oder manuell per Terminal. Das kennt ihr vielleicht nicht, wenn ihr Hilfe braucht ruft mich an. Funktioniert mit ```git rebase --continueundgit commit --amend --no-edit`. Ich würde dafür IntelliJ empfehlen)
  7. Is frontend directory wechseln und Dependencies installieren: cd frontend && yarn install
  8. Nun folgenden command ausführen: git rebase --strategy-option=theirs --exec 'npx prettier --write --single-quote --trailing-comma es5 --use-tabs false --semi --bracket-spacing false --print-width 120 `git show --name-only --pretty="" HEAD | grep -E --color=never ".*\.(js|ts|json|css|scss|html)$"` && git add `git show --name-only --pretty="" HEAD` && git commit --amend --no-edit --no-verify' develop
  9. Done! Euer feature branch sollte nun formatiert sein. Ab jetzt wird der Code immer automatisch formatiert bei einem Commit. Manuell kann die Formatierung mit yarn prettier:fix ausgeführt werden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment