Skip to content

glx merge-persons ​

Merge two person entities, keeping the first and folding in the second

Synopsis ​

Consolidate two person entities into one. The keep-id is retained; the drop-id's properties, notes, and cross-references are folded into it, then the drop-id person file is removed.

Resolved possibly_same_person relationships between these two people are removed and listed in the merge summary, including with --dry-run. Other relationships are retained and their person references follow the merge. Whole assertions depending on a removed relationship are deleted, regardless of status or confidence. ResearchLog subjects are cleared while their research is retained. Declared relationship-reference properties lose only matching whole values; sources, citations, media and unrelated assertions remain.

The preview lists every changed entity, deleted claim and cleared/pruned reference, plus changes to current standing, evidence, proof and coverage. Deleting claims can change existing interpretations (for example, a relationship with no remaining assertions is accepted under the existing fallback rules). Recovery requires a recorded pre-merge version; this command does not commit.

After reporting and validation, Apply this merge? [y/N] defaults to cancellation. --yes (-y) skips approval but still reports and validates. Noninteractive use requires --yes. --dry-run only reports, even with --yes, and never prompts. The preview remains visible with --quiet. A changed archive requires a new preview. Unrelated pre-existing validation errors are retained; an entity with structural errors cannot be edited safely and must be repaired first. Archives with duplicate entity IDs are refused, including in --dry-run; resolve the duplicates first. Relationships containing both merge IDs must be resolved before merging, except the binary possibly_same_person candidates that this command removes and reports. It never silently collapses participants. Merges refuse changes to linked GLX files (including Windows Git symlink placeholders) before approval, preserving the link and its target. Unchanged linked files in directory archives are retained. Run with exclusive archive write access; this command does not coordinate concurrent external writers.

Property merging:

  • Properties present only on drop are copied verbatim.
  • Identical values agree silently.
  • Temporal properties combine non-conflicting dated and undated history, including mixed scalar, structured, and list representations.
  • Other multi-value lists are unioned with deep-equal deduplication.
  • Genuine conflicts default to keep's value. --keep-newest or --keep-oldest resolves dated collisions while preserving unrelated history.
  • Approximate date values use ±2 years; --approximation-years overrides it.

Notes are combined per --notes-strategy (default: append).

This is the natural follow-on to glx duplicates: once you've identified that two person records are the same individual, this command consolidates them. Single-file writes use atomic replacement. Multi-file archives are updated in place: only changed files are rewritten in their original locations, and files left empty are deleted. Rollback and interrupted-write recovery safeguard the operation; unrelated files remain untouched.

glx merge-persons <keep-id> <drop-id> [flags]

Examples ​

  # Merge person-jungk-1750 into person-juncker-1750
  glx merge-persons person-juncker-1750 person-jungk-1750 --archive ./archive

  # Preview the merge
  glx merge-persons person-a person-b --archive ./archive --dry-run

  # Apply without prompting (for scripts)
  glx merge-persons person-a person-b --archive ./archive --yes

  # Resolve dated conflicts by picking the later entry
  glx merge-persons person-a person-b --archive ./archive --keep-newest

  # Replace keep's notes with drop's
  glx merge-persons person-a person-b --archive ./archive --notes-strategy prefer-drop

Options ​

      --approximation-years int   Tolerance in years for ABT, EST and CAL date values (0–10000) (default 2)
  -a, --archive string            Path to GLX archive (default ".")
      --dry-run                   Show what would change without writing
  -h, --help                      help for merge-persons
      --keep-newest               For conflicting temporal properties, keep the entry with the later date
      --keep-oldest               For conflicting temporal properties, keep the entry with the earlier date
      --notes-strategy string     How to combine notes: append | prefer-keep | prefer-drop (default "append")
  -y, --yes                       Apply the reported merge without prompting (validation still runs)

Options inherited from parent commands ​

  -q, --quiet   Suppress non-error output (where supported)

SEE ALSO ​

  • glx - GENEALOGIX CLI - Manage and validate genealogy archives

Licensed under Apache License 2.0