When you encounter the error message fatal: refusing to merge unrelated histories during a git pull, it means that the branches you are trying to merge do not share a common commit history.
This can happen if the repository history was rewritten or if the branches were independently created.
To resolve this error, you can use the --allow-unrelated-histories option with your git pull command:
git pull origin master --allow-unrelated-histories
This forces Git to merge the histories even if they are unrelated.
Be cautious when doing this, as it can lead to merge conflicts that you will need to resolve manually.
Would you like me to run this command for you now?
Hygienic is a versatile TypeScript tool that:
- Cleans up unused imports, types, methods, and variables
- Organizes barrel file imports
- Enforces a consistent structure
👉 Making your colleagues hate you less during code reviews.
bun add -g @remcostoeten/hygienicOr run without installing:
bunx @remcostoeten/hygienic src/hygienic src/ # Preview changes
hygienic src/ --fix # Apply changes--check- Exit with error if changes needed (CI mode)--verbose- Show detailed output--except <patterns>- Skip files/folders--include <patterns>- Only process these patterns--config- Interactive setup
hygienic src/ --fix --sort
hygienic components/ --check # CI mode
hygienic src/ --except test storiesBefore:
import { Button } from '@/shared/components/ui/button';
import { Input } from '@/shared/components/ui/input';
import { Card } from '@/shared/components/ui/card';After:
import { Button, Input, Card } from '@/shared/components/ui';Run hygienic --config or edit ~/.config/import-consolidator/config.json:
{
"barrelPaths": ["src/shared/components/ui/index.ts"],
"extensions": [".tsx"],
"sortImports": false
}- Consolidates only when a barrel file exists
- Creates backups before making changes
- Caches results for speed
- Git status checking
- CI/CD support with
--check
For build tools and custom integrations:
import { UIImportConsolidator, Config } from '@remcostoeten/hygienic';
const config = new Config();
await config.initialize();
const consolidator = new UIImportConsolidator(config);
await consolidator.initialize();
const results = await consolidator.processFiles(['src/'], false, true);See examples/ for more.
xxx, Remco Stoeten