Urgent.News

What's breaking now, across thousands of outlets.

Tech

Git Remembers How You Resolved That Conflict — If You Let It

You rebase a long branch onto main . The first commit conflicts in config.yml ; you resolve it. The second commit touches the same lines and conflicts in exactly the same way . So does the third. Each time you re-read both sides, re-make the same decision, and re-type the same lines. Git can remember the resolution. git rerere — reuse recorded resolution — is one config setting, and it comes with…

Git's rerere feature remembers how you resolved conflicts in the past, making future merges easier. When rebasing a long branch onto main, Git records the resolution of conflicts. If you encounter the same conflict again, Git will use the previously recorded resolution. However, Git does not automatically continue the rebase after applying the resolution.

You must manually inspect the resolved file, decide if it's correct, and then stage and continue the rebase. The second rule is that rerere only acts when the conflict is an exact match of the previously seen conflict. If the conflict has changed, rerere will not reuse the previous resolution. It's crucial to manually review the resolved conflict each time, as Git only matches on the conflicted lines, not the surrounding context.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Undo a Git Commit: Two Questions Before You Type Anything

"How do I undo a commit?" has four correct answers and three wrong ones, and the difference is not the command — it is two questions you ask before typing anything: Where is the change?

  • If change is in working tree, use git restore file to revert edit
  • If staged change is unwanted, use git restore --staged file to unstage
  • If committed and not pushed, use git reset --soft HEAD~1 to move pointer

Twelve Commits, One Regression, Four Test Runs: git bisect run

The test fails on main . It passed a week ago. Twelve commits landed in between, most of them documentation, and nobody remembers which one touched the code. You could read all twelve diffs.

  • git bisect tool finds regression-causing commit
  • Requires known bad, known good commits, and test
  • Test determines good/bad outcome, speeds up process

Stop Stashing. Use a Second Working Directory for the Interruption.

"Can you look at the login bug on main? Five minutes." You are forty minutes into a feature, with edits in six files that do not compile yet.

  • Use Git worktrees to manage interruptions, preserving original branch context
  • Create second working directory sharing .git database for feature branch
  • Remove worktree after hotfix merge without affecting main branch

I missed Go's `if err != nil`, so I built errval for TypeScript

I write mostly TypeScript and some Go. When I switch back from Go, I miss explicit error returns. A function that can fail says so, and I deal with it right there.

  • Author created TypeScript package errval to handle errors like Go's explicit returns.
  • errval offers inferred error unions with 1.86 kB minified size and zero dependencies.
  • Benchmark shows errval is faster than try/catch and plain try/catch in Node 24.16 environment.

Cyber vigilance efforts ramp up as GCash IPO draws first-time investors

The Cybercrime Investigation and Coordinating Center (CICC) is expected to play an important role in protecting first-time Filipino investors from cyber scams.

  • CICC to safeguard first-time Filipino investors in GCash IPO
  • Scammers could exploit novice investors through cyber scams
  • CICC-GCash partnership includes monitoring fraudulent schemes

More from Sunday 20 September →